Jump to content

estrify

uniGUI Subscriber
  • Posts

    454
  • Joined

  • Last visited

  • Days Won

    14

Posts posted by estrify

  1. One alternative: put a standard timer in the ServerModule to check periodically something, i.e.:

    • a global variable, that you can set through an admin form you might have to adminsitrate your application
    • monitorize the presence of a flag file
    • etc.
    You also can use a special URL and analyze it (if you do so, use some kind of encription to ensure that the call to stop UniGUI server is really yours).

     

    When you decide to stop the server monitoring variable/file/protocol/etc., simply execute Application.Terminate...

     

    Hope it helps...

     

    Regards,

  2. Hi,

    Don't know why but we have found that a simple Sleep(500) at the beginning on each menu item's onclick event, makes TUniMainMenu work as expected. In our case, problems were showing message dialogs within menu itme's onclick event... Those problems we only have them with Internet Explorer.

    Please, try.

    Regards,

  3. Hi,

    This is a sample of the easiest way to use under UniGUI the notification utility developed by http://www.eirik.net/Ext/ux/window/Notification.html .

     

    It also uses the alwaysOnTop feature (http://forums.unigui.com/index.php?/topic/3027-simple-tip-alwaysontop-feature-for-windows-and-forms/) to ensure that the notification is always visible and do not disappear behind any form...

     

    Regards,

    post-743-0-96802900-1371810959_thumb.png

    20130621_Notifications.rar

    • Upvote 4
  4. Hi,

    Please, try this... It will not resolve the problem, but at least, the restart page will be shown at most only once to the user for each session (in our case, that page entered in a loop always showing the restart page to the user indefinitely): modify UniServerModule->ServerMessages->TerminateTemplate with the following:

    • Add a simple function to generate random text like following:

    <script language="javascript" type="text/javascript">
    function randomString(){

    var sChars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
    var iStringLength=32;
    var sRandom="";
    for (var i=0; i<iStringLength; i++){

    var iRNum=Math.floor(Math.random()*sChars.length);
    sRandom+=sChars.substring(iRNum, iRNum+1);

    }
    return(sRandom);

    }
    </script>

    • Comment or delete standard anchor given:

    <!--<p style="text-align:center;color:#A05050"><a href="[###url###]">Restart application</a></p>-->

    • and replace it with a simple dummy form:

    <form action="[###url###]" method="post"><input type="hidden" name="dummy" value=""></form>
    <p style="text-align:center;color:#0000FF">
    <a style="cursor: pointer" OnClick="document.forms[0].dummy.value=randomString();document.forms[0].submit();">
    <u>Restart application</u></a></p>

     

    Hope it could help.

     

    Regards,

  5. Hi,

    Don't use 

     

    function OnBeforerender(sender)
    {
        sender.emptyText='
    text to display when the field is empty';
    }

     

    instead, use this UniEvent

     

    function OnBeforeInit(Sender)
    {
        Ext.Apply(sender, { emptyText: '
    text to display when the field is empty' });
    }

     

    This will avoid in IE bugs like one reported in http://forums.unigui.com/index.php?/topic/3036-problem-with-unicombobox-to-show-selection/

     

    Regards,

    • Upvote 1
  6. I tried to create another project using this workaround for AlwaysOnTop, but I failed.

    Here is what I did:

    • Copy-Paste AlwaysOnTop.js in the project root
    • ServerModule->CustomFiles="AlwaysOnTop.js"
    • Form->TUniClientEvents->ExtEvents->OnBeforerender :
    function window.OnBeforerender(sender)
    {
       Ext.apply(sender, {
    			alwaysOnTop: true
       });
    }
    

    Unfortunately, this was not enough the form shows as a regular form. I've also tried to put the full path to AlwaysOnTop.js under ServerModule.CustomFiles: nothing changes.

    What am I missing here?

     

    I think that was all... It could be the following: be sure that you are writing code within OnBeforerender of Ext.Window, not of Ext.form.FormPanel...

  7. Title: UniEdit's and UniMemo's OnChange event fire as they are onkey events

    Description:
    Within UniEdit and UniMemo, OnChange event is fired in the server practically with each keystroke, what is strongly discouraged in a web application.

    Development Environment:
    Delphi 2010 w. UniGUI 0.93.0.996

    Browser
    FF and IE

    Steps to reproduce:
    See test case

    Test case:
    20130514_UniEdit_and_UniMemo_OnChange_Event_Seems_OnKey.rar
     

     

    20130514_UniEdit_and_UniMemo_OnChange_Event_Seems_OnKey.rar

    • Upvote 1
  8. Go to panel's ClientEvent -> UniEvents -> OnBeforeInit and add the following:

     

    function OnBeforeInit(sender)

    {

          Ext.apply(sender, {

                style: 'opacity: 0.5;'

          });

    }

     

    Regards,

    • Upvote 1
  9. Hi,

     

    This is a sample of how to include a Clear Button in text fields using as a base the ClearButton plugin developed by fit4dev (http://www.eekboom.de/ClearButton.html).

    To see it running, move mouse over a field. If the field is not empty, a clear button will appear at the rightmost of it. If you click the button, the field will be cleared and an ajax request will be generated.

    Regards,
     

    20130423_ClearButton_Plugin.rar

    • Upvote 5
×
×
  • Create New...