Tagged: 

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #101600
    tullio0106
    Member

    I downloaded the trial version, I extracted from zip file everithing and I tried to intergrate with my application.
    I don’t use npm.
    I got from source/module all js I needed (e.g, combobox, checkbox table etc..) and I moved them to my web application .
    I used them in my code.
    Now I see the following strange behaviour : every few seconds the http://www.htmlelements.com url appears and the page refresh, making impossible any operation.
    Did I forgot something (e.g. license, where is it) ?
    Tks

    #101602
    admin
    Keymaster

    Hi tullio0106,
    The popup with https://www.htmlelements.com/ url and a console log is displayed once you run a Trial version. Trial version is for evaluation purposes only. Popup message is not displayed only for the Free Components – Table, Tabs, Tree and Menu. For the rest of the components it is displayed.
    Best regards,
    Peter Stoev
    Smart UI Team
    https://www.htmlelements.com/

    #101605
    tullio0106
    Member

    I understand but the problem is that when the message appears the page is refreshed and refreshed and refreshed every few seconds making the test impossible.
    How can avoid this ?
    Tks

    #101606
    admin
    Keymaster

    Hi,
    Please share an example and step by step instructions reproducing that.
    Best regards,
    Peter Stoev
    Smart UI Team
    https://www.htmlelements.com/

    #101607
    tullio0106
    Member

    I found the cause but not the solution.
    In many smart-combobox, on my page, I’ve an onchange event which refreshes the page.
    <smart-combo-box id=”e818843742″ name=”e818843742″ drop-down-position=”bottom” optional=”true” type=”combo” desc=”ProdottoFERRETTI” onchange=”mostraAlertMsgOption(this); eseguiRefresh(this);” onfocus=”on_focus(this)”>
    This produces the continous refresh but the question is why ?
    Tks

    #101608
    tullio0106
    Member

    The snippet
    <smart-combo-box id=”e818843742″ name=”e818843742″ drop-down-position=”bottom” optional=”true” type=”combo” desc=”ProdottoFERRETTI” onchange=”mostraAlertMsgOption(this); eseguiRefresh(this);” onfocus=”on_focus(this)”>
    <smart-list-item value=”**”>
    </smart-list-item>
    <smart-list-item value=”LAN” selected=””>Lang</smart-list-item>
    </smart-combo-box>

    #101618
    yavordashew
    Member

    Hi Tullio,
    We hope that you will be satisfied with our components.I guess by trial version you use the community version which will have the watermark showing up except for our free components such as Table, Tree, Tabs, Menu
    However we have tested the combobox with the code that you provided us and looking at the function I can suggest that mostraAlertMsgOption(this); eseguiRefresh(this); functions are invoking an alert message and a page reload. After some testing I encountered your problem in Firefox and the problem was coming from the selected attribute from the list item which is a native HTML attribute.Solution for fixing this is to use selectedIndexes or selectedValues property of the combobox.A quick example on how to do this :
     `<smart-combo-box id=”combobox” name=”e818843742″                     
    drop-down-position=”bottom”                     
    selected-indexes='[1]’  
                       onchange = “mostraAlertMsgOption();reloadFunction();”>        
    <smart-list-item value=”LAN” >Lang</smart-list-item>       
     <smart-list-item value=”LAN2″ >Lang2</smart-list-item>    
    </smart-combo-box>`
    If you prefer to use selctedValues just replace the selected-indexes with selected-values= '["LAN"]'.
    Please, do not hesitate to contact us if you have any additional questions.
    Best regards,
    Yavor Dashev
    Smart UI Team
    https://www.htmlelements.com/

    #101654
    tullio0106
    Member

    Now I was able to test but unfortunately it didn’t work.
    Also using the code reported below it loops doing refresh many and many times.
    I got the problem only on firefox, on chrome it seems to work (but I can’t force user to use chrome).
    Please help
    Tks
    <smart-combo-box id=”e656142201″ name=”e656142201″ drop-down-position=”bottom” selected-indexes=”[1]” optional=”true” type=”combo” desc=”ProdottoFERRETTI” onchange=”mostraAlertMsgOption(this); eseguiRefresh(this);” onfocus=”on_focus(this)”>
    <smart-list-item value=”**”>
    </smart-list-item>
    <smart-list-item value=”LAN”>Lang</smart-list-item>
    </smart-combo-box>

    #101656
    yavordashew
    Member

    Hi tullio0106,
    We will require a full code example in order to duplicate you issue and give you a solution.
    However I have a code example on your problem and I don’t encounter problem, the problem may be caused by some of your functions.
    //In your HTML

    
        <smart-combo-box id="combobox"
                        name="e818843742"
                        drop-down-position="bottom"
                        selected-indexes='[1]'
                        onchange = "mostraAlertMsgOption();reloadFunction();"
                        optional="true"
                        type="combo"
                        desc="ProdottoFERRETTI"
                        onfocus="on_focus();"
                        >
            <smart-list-item value="LAN" >Lang</smart-list-item>
            <smart-list-item value="LAN" >Lang</smart-list-item>
            <smart-list-item value="LAN" >Lang</smart-list-item>
            <smart-list-item value="LAN" >Lang</smart-list-item>
            <smart-list-item value="LAN" >Lang</smart-list-item>
            <smart-list-item value='**'></smart-list-item>
        </smart-combo-box>
    

    In your Js file:

    
     function on_focus() {
                console.log('on_focus function')
            }
      function mostraAlertMsgOption(){
            alert('test');
            };
            function reloadFunction (){
                window.location.reload();
            }
    

    Please, do not hesitate to contact us if you have any additional questions.
    Best regards,
    Yavor Dashev
    Smart UI Team
    https://www.htmlelements.com/

    #101662
    tullio0106
    Member

    I tested Your example standalone and it worked.
    I substituted the refresh with a simple alert, in my code and still it execute onchange fo every combobox (not for textbox).
    Now I need to understand the difference between Your example and my situation.
    I use jquery (version 3.1, but I can upgrade without pain if needed) and jqueryUi (last version) are they compatible with your code ?
    Any further suggestion ?
    Tks
    Tullio
     

    #101665
    tullio0106
    Member

    Finally I was able to create a testcase.
    Is my code cleaned from every non smart element component and reproduces the error.
    I run it from my application server tomcat (I don’t know if it could be relevant).
    Not every combobox produces the wrong situation (6 over 9).
    As You can observe the alert message, connected to the onchange is executed before the combobox is shown.
    On chrome it works, on firefox no.
    Tks foy your help
    Tullio
    I sent it You by mail
     

    #101666
    yavordashew
    Member

    Hi tullio0106,
    Thank you for creating a code example of this issue with which I was able to duplicate it.
    I have two option for which eliminate this issue.
    The first one is replace the code in your script tag with this code snippet:

    
        <script type="text/javascript">
            window.onload = () => {
                 let combobox = document.querySelectorAll('smart-combo-box');
                 for (let i = 0; i < combobox.length; i++) {
                    combobox[i].onchange = function (event) {
                        eseguiRefresh(event)
                    }
                 }
            function eseguiRefresh() {
                alert("test "+event.currentTarget.id);
             }
             function mostraAlertMsgOption(elem) {
             }
        }
        </script>

    With the code above you don’t need to bind to ‘this’ like in the rest of your code in your example to get the combobox id and you can remove the eseguiRefresh() function from the smart-combo-boxx itself.
    Also the shouldn’t be a problem to use our components with other libraries like with the ones you mentioned.
    One other thing to mention is that I tested your code with my previous solution and it worked.
    In the smart-combo-box I used selected-indexes instead of selected-values like you do in your code example and with selected-indexes the issue was not present at all.
    However if the problem still persists I will be glad to be able to help you again!
    Please, do not hesitate to contact us if you have any additional questions.
    Best regards,
    Yavor Dashev
    Smart UI Team
    https://www.htmlelements.com/

    #101667
    tullio0106
    Member

    Hi
    I cant’ use the first solution because, in my real world, the refresh is called by the onchange event and not on the windows.onload and in the real code I need the changed element.
    The second simpy doesn’t work in my environment.
    I sent you by mail the modified code wich reproduces with selected-indexes.
    Tks
    ​​​​​​​Tullio

    #101675
    yavordashew
    Member

    Hi tullio0106,
    I don’t know if you tested my code example that I send but let me clarify it a bit.
    window.onload in this case its executed when the whole page to be completely loaded with including all dependent resources such as stylesheets and images but one important thing to note here that it doesn’t fire any events at all and we just add an event listener onchange for every combobox and from it you can access the changed element id for example and I didn’t get the modified code from you.
    Please, do not hesitate to contact us if you have any additional questions.
    Best regards,
    Yavor Dashev
    Smart UI Team
    https://www.htmlelements.com/

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.