Jump to content

shawdown

uniGUI Subscriber
  • Posts

    142
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by shawdown

  1. Hello, I'm starting beta testing to contribute to the tests and compiling my project in the latest version.
     
    Whenever I try to use the code below in the beta version "1.0.2.1442" my project gets white screen and no error is returned in the logs.
    But in that stable version "1.0.0.1425" is working perfectly.
    ClientEvents.ExtEvents.add('beforerender=function beforerender(sender, eOpts) { sender.addClass("icon_normal");  }');
     
    Was it a bug? Do I have an alternative?
     
     
    Simples CSS
    .icon_normal {
        border:0px solid transparent;
    }
    
    
    .icon_normal:hover {
        border:2px solid transparent;
    }
    
     
     

    This UniGUI Log

    ApoioVendas.exe: 00001294: 17:16:28 []:>--------------------------------------------------------------<
    ApoioVendas.exe: 00001294: 17:16:28 [TUniServerModule]:Server First Init.
    ApoioVendas.exe: 00001294: 17:16:28 [TUniServerModule]:Erasing Cache Folder...
    ApoioVendas.exe: 00001294: 17:16:28 [TUniServerModule]:Cache Folder Erased. <62> Files deleted.
    ApoioVendas.exe: 00001294: 17:16:28 [vExtRoot]:
    ApoioVendas.exe: 00001294: 17:16:28 [vUniRoot]:
    ApoioVendas.exe: 00001294: 17:16:28 [vTouchRoot]:
    ApoioVendas.exe: 00001294: 17:16:28 [vUniMobileRoot]:
    ApoioVendas.exe: 00001294: 17:16:28 [vUniPackagesRoot]:
    ApoioVendas.exe: 00001294: 17:16:28 [TUniServerModule]:Starting HTTP Server...
    ApoioVendas.exe: 00001294: 17:16:28 [TUniServerModule]:HTTP Server Started. Port: 8077
     
  2.  

    me.body.el.dom.addEventListener...

    function afterrender(sender, eOpts)
    {
        var me = sender;
        me.body.el.dom.addEventListener('scroll', function(event) {
            var element = event.target;
            if (element.scrollHeight - element.scrollTop === element.clientHeight) {
                ajaxRequest(me, 'scrolledToBottom', []);
            }
        })
    }
    Perfect
     
    My need was to capture when the scroll bar was at the top.
     
    Here's an example.
     
        var me = sender;
    me.body.el.dom.addEventListener('scroll', function(event) {
            var element = event.target;
    
    
    if (element.scrollTop === 0) {
                ajaxRequest(me, 'scrolledToBottom', []);
            }
        })

    Thanks Friend.

  3.  

    Maybe like this ?!:

     

    1. UniScrollBox1 -> ClientEvents -> ExtEvents -> function afterrender:

    function afterrender(sender, eOpts)
    {
        var me = sender;
        me.el.dom.addEventListener('scroll', function(event) {
            var element = event.target;
            if (element.scrollHeight - element.scrollTop === element.clientHeight) {
                ajaxRequest(me, 'scrolledToBottom', []);
            }
        })
    }

    2. UniScrollBox1 -> OnAjaxEvent:

    procedure TMainForm.UniScrollBox1AjaxEvent(Sender: TComponent;
      EventName: string; Params: TUniStrings);
    begin
      if EventName = 'scrolledToBottom' then
      begin
        AddSomeMoreRows
      end;
    
    end;

     

    Perfect solution for UniScrollBox.
     
    I tried with UniHTMLFrame but it does not work.
    Any suggestion?
  4. Hi,

     

     

    Ok, can you try to use this approach for now ?!:

    //UniHTMLMemo1.JSInterface.JSCall('focus', []);
    UniHTMLMemo1.JSInterface.JSCode('if (Ext.isChrome) {'#1'.iframeEl.el.dom.contentDocument.body.focus()} else {'#1'.focus()};');

    Best regards,

    Perfect.
     
    Thank you very much for your attention.
    • Like 1
  5. I'm doing a "chat" messaging system.

     

    After the user login I make a request to an http server that only responds if a new message arrives or reaches a time limit of 120 seconds.

     

    The problem is that when I make this request unigui is waiting for the response and it is not possible for the user to continue using the application.

     

    I would like to know how to run this http request in the background without freezing the application. Because unigui is waiting for the http server response.

     

     

    Sorry if I can not be very clear because I'm using Google Translate.

    If necessary I can give an example of this situation.

  6. Hello everyone.

     

    My project is set to EnableSynchronousOperations set to true.

     

    I need to make a request from a json on a remote server, but this call may take some time to get up to 2 minutes.

     

    How to capture this json without freezing my application?

    So while waiting for this json to be captured I can go using the application.

  7. Hi,

     

    Thanks for the testcase,

     

    Online demo example works for me.

     

    Which browser are you using ?!

     

    I'm using "Google Chrome Version 63.0.3239.132 (Official Version) 64-bit (Last Update)"

    In Internet Explorer 11 there is also a problem.

     

     

    The problem continues even with the code being reported.
    UniSession.AddJS('Ext.defer(function(){Ext.get("'+ UniHTMLMemo1.JSName +'_id-inputCmp-iframeEl").focus()},100)');

    In firefox it works perfectly.

  8. Hi,

     

    One of the possible solution, while, try:

    procedure TMainForm.UniButton1Click(Sender: TObject);
    begin
      UniSession.AddJS('Ext.get("'+ UniHTMLMemo1.JSName +'_id-inputCmp-iframeEl").focus()');
    end;

    Best regards.

     

    This code is not working in my project.
    It does not display any errors but the focus is not set.
     
    I am using version 1.0.0.1422.
     
    Any suggestion?
  9. Hello Developer thank you very much for your attention.
     
    The problem does not happen when I use the code you entered.
    UniHTMLFrame1.JSInterface.JSCode('Ext.DomHelper.insertFirst(Ext.get("'#1'_id-innerCt"), {tag: "div", cls: "yourCls", html: "<b>N</b>ew line"});');

     

    One last question.
    Do you think it's appropriate to use UniHTMLFrame to create a chat like the example below?
     
    What do you suggest?
     
     
  10. Hello everyone.

     

    I am initiating a chat with the UniHTMLFrame component and some doubts appeared.

     

    1 - How do I make the vertical scroll bar go down or up completely?

     

     

    2 - What better way to add text at the beginning of html?

    I am using the following code. 



    UniHTMLFrame1.HTML.Text: = 'My Message <br>' + UniHTMLFrame1.HTML.Text;


    3 - After adding a message at the beginning of the html how can I preserve the current position of the scroll bar? "so no matter what text size was added at the beginning of the html, UniHTMLFrame continues to display the same content it was before adding text at startup.

     

     

    Sorry for my bad English.

    And thank you all.

×
×
  • Create New...