queue click action running multiple times for one click.

Matt SonesMatt Sones Member ✭✭
edited February 4 in Problems
Hi Skuid.

I have a queue component that is running it's click action multiple times.





Help?

I have no actions on any of the models.
«1

Answers

  • Matt SonesMatt Sones Member ✭✭
    edited October 2017
    Oh, and I'm on 9.5.14.
  • Matt SonesMatt Sones Member ✭✭
    edited October 2017
    There are 6 rows in the model.

    Clicking on item X runs the click action Y times:
    X   Y
    1   7
    2   6
    3   5
    4   4
    5   3
    6   2
  • edited February 4
    I just started having this happen: I have Nav components that open a URL in a new browser window. Now when I click them, it opens 3 browser windows in chrome. I did not recently update Skuid. I ha s been running 10.0.5 for a while.
  • Matt SonesMatt Sones Member ✭✭
    edited October 2017
    Perhaps this is a chrome problem?
  • Mark DeSimoneMark DeSimone Skuid Mod admin
    edited February 4
    Hi Matt,

    I have been able to use the XML below to reproduce the behavior you're describing, but only when the model is a UI-only model - using a model on Account, the Queue running the snippet works as expected. You can use the table to add rows to the UI only model, then click one of the queue items to see the console log.

    I also added a button that will adopt records from a non un-only model (in this case, the Account model) into the ui-only model. If you do this, then click on a queue item, the issue doesn't happen. It seems like because the UI-only rows are only given the fields we choose to create for them, there may be some metadata missing that the Queue uses for context. 
    I will continue researching this, and will let you know what I find. <skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" useviewportmeta="true" showheader="true">    <models>
                <fields>
                    <field id="Id"/>
                    <field id="Name"/>
                </fields>
                <conditions/>
                <actions/>
            </model>
            <model id="UI" query="true" createrowifnonefound="true" datasource="Ui-Only" processonclient="true">
                <fields>
                    <field id="Name" displaytype="TEXT" label="Name"/>
                    <field id="Id" displaytype="UUID" label="Id" ogdisplaytype="TEXT"/>
                </fields>
                <conditions/>
                <actions/>
            </model>
        </models>
        <components>
            <buttonset model="UI" uniqueid="sk-s67UV-252">
                <buttons>
                    <button type="multi" label="Adopt account rows into UI model" uniqueid="sk-s67kH-256">
                        <actions>
                            <action type="adoptRows" sourcemodel="Acc" targetmodel="UI" affectedrows="all"/>
                        </actions>
                    </button>
                </buttons>
            </buttonset>
            <queue model="UI" tagrendertype="template" searchbox="true" tokenizesearch="true" showsearchbydefault="true" uniqueid="sk-s423n-94">
                <rendertemplate>{{Name}}</rendertemplate>
                <interactions>
                    <interaction type="tap">
                        <action type="custom" snippet="newSnippet"/>
                    </interaction>
                </interactions>
            </queue>
            <skootable showconditions="true" showsavecancel="true" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" alwaysresetpagination="false" createrecords="true" model="UI" buttonposition="" mode="read" allowcolumnreordering="true" responsive="true" uniqueid="sk-s549s-209">
                <fields>
                    <field id="Name" hideable="true" uniqueid="fi-s55NV-223"/>
                    <field id="Id" hideable="true" uniqueid="fi-s6huc-278"/>
                </fields>
                <rowactions>
                    <action type="edit"/>
                    <action type="delete"/>
                </rowactions>
                <massactions usefirstitemasdefault="true">
                    <action type="massupdate"/>
                    <action type="massdelete"/>
                </massactions>
                <views>
                    <view type="standard"/>
                </views>
            </skootable>
        </components>
        <resources>
            <labels/>
            <javascript>
                <jsitem location="inlinesnippet" name="newSnippet" cachelocation="false">var params = arguments[0],
    $ = skuid.$;
    console.log(arguments);</jsitem>
            </javascript>
            <css/>
        </resources>
        <styles>
            <styleitem type="background" bgtype="none"/>
        </styles>
    </skuidpage>
      
  • Mark DeSimoneMark DeSimone Skuid Mod admin
    edited October 2017
    Hi Raymond, is this happening across the board for nav components that open URLs in a new window? 
  • Mark DeSimoneMark DeSimone Skuid Mod admin
    edited February 4
    Matt, I wanted to let you know that we have identified this as a product issue, and it's currently being worked on. I'm hoping a fix for this will be available soon, but I don't have an ETA yet. Thank you for taking the time to demonstrate the issue. 
  • edited October 2017
    I think it is a coincidence. I think it is my track pad giving me problems. It is happening on multiple sites. Just happened to start at the same time as Matt’s problem. Disregard. Thanks!
  • Matt SonesMatt Sones Member ✭✭
    edited October 2017
    another one of those times a software issue turns out to be a hardware issue... ;)
  • Arne-Per HeurbergArne-Per Heurberg Member ✭✭
    edited February 2018
    any word on this? Thanks
  • Mark DeSimoneMark DeSimone Skuid Mod admin
    edited March 2018
    Hi Arne-Per,

    I'm just seeing your request for an update. It looks like this was resolved in mid-November, shortly after Millau was first released. The fix should have been in 10.0.12+ and 11.x versions. Are you still experiencing the issue? If so, please let me know which version of Skuid is involved, and any other details about your scenario. 
  • Matt SonesMatt Sones Member ✭✭
    edited March 2018
    I've still been experiencing this problem on 10.0.15.
  • Arne-Per HeurbergArne-Per Heurberg Member ✭✭
    edited March 2018
    Still seeing it in 11.1.6
    image
  • Mark DeSimoneMark DeSimone Skuid Mod admin
    edited March 2018
    Matt and Arne-per, I'm revisiting the repro page I used in October to verify this issue in 10.0.19, and I can't seem to reproduce the issue. My page has a queue on a UI-only model, and clicking on a queue item runs a snippet that runs a console.log('hello'); 

    If I'm remembering right, the snippet would run multiple times, depending on which row you clicked on. I've tried different configurations on the page, but the snippet's only running once per click. 

    Matt, if you're still seeing the behavior in your versions, do you have any way to spin up a sandbox or dev environment to test your affected pages in 10.0.19?

    Arne-Per, are you able to provide more detail about your scenario? The screenshot is helpful, but it would be helpful to also see the queue's action sequence and the snippet that's running too many times. 

  • Arne-Per HeurbergArne-Per Heurberg Member ✭✭
    edited March 2018
    HI Mark,

    Yes the queue interaction is 'click' and the action is a simple page include update
  • Matt SonesMatt Sones Member ✭✭
    edited March 2018
    Mark,

    Upgraded a dev environment to 10.0.19. Still seeing the same behavior:




  • Mark DeSimoneMark DeSimone Skuid Mod admin
    edited March 2018
    Thank you for taking the time to demonstrate your scenario. Is the getAvailableFields snippet being run on pageload, or when a queue item is clicked?
  • Mark DeSimoneMark DeSimone Skuid Mod admin
    edited March 2018
    Arne-Per,

    In your scenario, you have a queue interaction that updates a page include, correct? When a user does this, is the issue that they're seeing multiple copies of the page include? Is it always the same number of duplicates, or is it different depending on how far down in the queue they clicked?
    Also, can you tell me what the Queue's model is like? Is it a UI-only model, or is it attached to a Salesforce object?

    Thanks. I'm looking for more details since I haven't yet been able to reproduce the behavior in 10.0.19 or 11.1.6, and I'm hoping to find out what you and Matt Sones have in common. 
  • Matt SonesMatt Sones Member ✭✭
    edited March 2018
    getAvailableFields runs on pageload: 
    (function(skuid){
    var $ = skuid.$;
    $(document.body).one('pageload',function(){
    skuid.snippet.getSnippet('getAvailableFields')();
    });
    })(skuid);
    And it also runs when the SignatureFields model (the table's model) is saved.
  • Matt SonesMatt Sones Member ✭✭
    edited March 2018
    It may be that everywhere I've experienced this it's on a page that's being included on another page? Perhaps try including your test page in anther page and see what happens?
  • Arne-Per HeurbergArne-Per Heurberg Member ✭✭
    edited March 2018
    Mark- no matter where in queue. It is the number of clicks that causes the commensurate number page include instances
  • Arne-Per HeurbergArne-Per Heurberg Member ✭✭
    edited March 2018
    So here is a reduced example. and video of original. In the small test the addEventListener is added, It could be that the included page is so small that it doesn't allow for the the listener to be updated which is why it infact works with larger included page. Thanks for continuing to look at it.

    image

    <skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="false" showheader="true" cachepage="true" useviewportmeta="true">
        <models>
            <model id="testMC" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Product2">
                <fields>
                    <field id="Name"/>
                </fields>
                <conditions>
                    <condition type="fieldvalue" value="210" enclosevalueinquotes="true" field="Name" operator="contains"/>
                </conditions>
                <actions>
                    <action>
                        <actions>
                            <action type="requeryModel" model="emQueueProd" behavior="standard"/>
                        </actions>
                        <events>
                            <event>condition.valueChanged</event>
                        </events>
                    </action>
                </actions>
            </model>
        </models>
        <components>
            <grid uniqueid="sk-3VAMFM-177">
                <divisions>
                    <division behavior="fit" verticalalign="top" uniqueid="qDiv">
                        <components>
                            <wrapper uniqueid="sk-3zQJos-1368">
                                <components>
                                    <queue model="testMC" tagrendertype="template" searchbox="false" tokenizesearch="true" showsearchbydefault="true" uniqueid="sk-3waS_Y-2934" title="Queued Up" searchmethod="server" emptysearchbehavior="remove" instantfilters="false" hideheader="false">
                                        <rendertemplate>{{Name}}:
    {{Make__c}}:{{Description_from_DIS__c}}</rendertemplate>
                                        <interactions>
                                            <interaction type="tap">
                                                <action type="updateIncludePanel" querystring="id={{Id}}" panelid="emTry3" pagename="testMultiClickPI"/>
                                            </interaction>
                                        </interactions>
                                        <searchfields usesosl="false" soslfields="Name Fields"/>
                                        <renderconditions logictype="and"/>
                                        <filters/>
                                    </queue>
                                </components>
                                <styles>
                                    <styleitem type="background"/>
                                    <styleitem type="border"/>
                                    <styleitem type="size" width="custom">
                                        <styles>
                                            <styleitem property="max-width" value="50vw"/>
                                        </styles>
                                    </styleitem>
                                </styles>
                                <renderconditions logictype="and"/>
                            </wrapper>
                        </components>
                    </division>
                    <division behavior="flex" verticalalign="top" ratio="1" minwidth="48vw">
                        <components>
                            <wrapper uniqueid="sk-lsp-808">
                                <components>
                                    <pagetitle model="testMC" uniqueid="sk-lsp-819">
                                        <subtitle>
                                            <template>{{Model.label}}</template>
                                        </subtitle>
                                        <actions/>
                                        <maintitle>This is a Very sparse test</maintitle>
                                    </pagetitle>
                                </components>
                                <styles>
                                    <styleitem type="background"/>
                                    <styleitem type="border"/>
                                    <styleitem type="size"/>
                                </styles>
                            </wrapper>
                            <includepanel type="skuid" uniqueid="emTry3" querystring="" lazyload="true">
                                <renderconditions logictype="and"/>
                            </includepanel>
                        </components>
                    </division>
                </divisions>
                <styles>
                    <styleitem type="background" bgtype="none"/>
                </styles>
                <renderconditions logictype="and"/>
            </grid>
        </components>
        <resources>
            <labels/>
            <javascript>
                <jsitem location="external" name="Apex Ajax Toolkit" cachelocation="false" url="/soap/ajax/41.0/apex.js ">var params = arguments[0],
    $ = skuid.$;
    </jsitem>
            </javascript>
            <css>
                <cssitem location="inline" name="CenterText" cachelocation="false">.bang2 field {
        text-align: center;
    }</cssitem>
                <cssitem location="inline" name="addSpace" cachelocation="false">.nx-actionselect-dropdown-item {    
    padding-right:50px;
    }</cssitem>
            </css>
            <actionsequences uniqueid="sk-36hz2V-1465">
                <actionsequence id="16eb7e42-b15c-42aa-88f6-bb3c67a0e2fa" label="ToggleQueue" uniqueid="sk-3UZMEx-606">
                    <actions>
                        <action type="toggleRenderComponent" behavior="toggle" componentid="queRGdiv"/>
                        <action type="updateRow" fieldmodel="emQueueProd" affectedrows="context" field="HideFirst" enclosevalueinquotes="false" value="false"/>
                        <action type="updateRow" fieldmodel="emQueueProd" affectedrows="context" field="dontHideQueue" enclosevalueinquotes="false" value="true"/>
                    </actions>
                    <description/>
                </actionsequence>
            </actionsequences>
        </resources>
        <styles>
            <styleitem type="background" bgtype="none"/>
        </styles>
        <interactions/>
    </skuidpage>

    ______

    <skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" useviewportmeta="true" showheader="true">
        <models>
            <model id="difProd" limit="20" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Product2">
                <fields>
                    <field id="Name"/>
                </fields>
                <conditions>
                    <condition type="param" value="id" field="Id" operator="=" enclosevalueinquotes="true"/>
                </conditions>
                <actions/>
            </model>
        </models>
        <components>
            <grid uniqueid="sk-lvn-202">
                <divisions>
                    <division behavior="flex" minwidth="100px" ratio="1">
                        <components>
                            <pagetitle uniqueid="sk-lvn-216" model="difProd">
                                <maintitle>{{Name}} we are ttest</maintitle>
                                <subtitle>
                                    <template>{{Model.label}}</template>
                                </subtitle>
                                <actions/>
                            </pagetitle>
                        </components>
                    </division>
                </divisions>
                <styles>
                    <styleitem type="background" bgtype="none"/>
                </styles>
            </grid>
        </components>
        <resources>
            <labels/>
            <javascript/>
            <css/>
            <actionsequences uniqueid="sk-lvn-265"/>
        </resources>
        <styles>
            <styleitem type="background" bgtype="none"/>
        </styles>
    </skuidpage>






  • Mark DeSimoneMark DeSimone Skuid Mod admin
    edited March 2018
    Arne-Per,

    Thank you for providing your test pages. I'm not seeing any strange behavior when trying these two test pages, unfortunately. I also don't see any eventlisteners or error messages about them. In your Queue's display template, can you try changing this

    {{Name}}:
    {{Make__c}}:{{Description_from_DIS__c}}

    to this:
    {{{Name}}}:
    {{{Make__c}}}:{{{Description_from_DIS__c}}}

    and let me know if that makes a difference?

    Is there any script happening in the Queue actions? 


  • Mark DeSimoneMark DeSimone Skuid Mod admin
    edited March 2018
    Matt, I did try your suggestion, but still haven't seen the behavior you're showing. I'm wondering if there's something in your script that's operating more times than you're expecting. Have you tried to reproduce the issue with a very simple console.log, or something like that?
  • Arne-Per HeurbergArne-Per Heurberg Member ✭✭
    edited March 2018
    Mark, I'll try but the picture in the post is the error I get using the sample pages. No script happening . Why the {{{}}}}?
  • Arne-Per HeurbergArne-Per Heurberg Member ✭✭
    edited March 2018
    I didn't add event listener. That was error that was generated on multiple . Mistype . Sorry for confusion.
  • Mark DeSimoneMark DeSimone Skuid Mod admin
    edited March 2018
    Arne-Per, I am seeing the event listener error when I click multiple queue items quickly. I think it's happening because the page include component isn't ready for the input. I'd recommend blocking the UI while the page include loads, so users won't be able to click again until the included page has loaded. 
  • Arne-Per HeurbergArne-Per Heurberg Member ✭✭
    edited March 2018
    Thanks Mark, In my page I have a UI block.
  • Matt SonesMatt Sones Member ✭✭
    edited March 2018
    Mark,

    Here's a couple examples with just a console.log() as the queue click action. In both examples, the queues model is created with javascript on pageload. In the first example, it is a ui-only model. In the second example, it is a model on a custom salesforce object, with two newly created and unsaved rows.




  • Mark DeSimoneMark DeSimone Skuid Mod admin
    edited February 4
    Thank you both for your patience.

    Matt, I now see this issue happening in the latest maintenance release of 10.0.x ( due out shortly), but in Millau releases like 11.0.8 and 11.1.6, the snippet is only being called once per click (i.e. working as expected). We will continue investigating this issue in the 10.0.x branch.

    Arne-Per, I believe this means your issue isn't related to the one that's surfaced in this email thread, even though it looks quite similar. Would you be able to set up a new post capturing the current status of that issue, and linking to it here? 

    Below is the XML I used to reproduce this issue, in case it's useful:
    <skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" useviewportmeta="true" showheader="true">
        <models>
            <model id="UI" query="true" createrowifnonefound="true" datasource="Ui-Only" processonclient="true">
                <fields>
                    <field id="Name" displaytype="TEXT" label="Name" defaultvaluetype="fieldvalue" defaultValue="default name"/>
                    <field id="Id" displaytype="UUID" label="Id" ogdisplaytype="TEXT"/>
                </fields>
                <conditions/>
                <actions/>
            </model>
            <model id="Acc" limit="20" query="false" createrowifnonefound="false" datasource="salesforce" type="" sobject="Account">
                <fields>
                    <field id="Id"/>
                    <field id="Name"/>
                </fields>
                <conditions/>
                <actions/>
            </model>
        </models>
        <components>
            <template multiple="false" uniqueid="sk-14kMfe-210">
                <contents>&lt;ol&gt;Steps to reproduce issue:
        &lt;li&gt;Open browser JS console.&lt;/li&gt;
        &lt;li&gt;Click button to "Add a row to UI model" a few times&lt;/li&gt;
        &lt;li&gt;Click each newly created row in the Queue. An Interaction will run a snippet that creates a console.log().&lt;/li&gt;
        &lt;li&gt;Observe console for how many console logs are created&lt;/li&gt;
    &lt;/ol&gt;
    Expected Behavior: One console log should be present for each item clicked on queue
    observed Behavior: Several console logs are being created. This means the script is running multiple times for each click (the lower on the list the item is, the fewer # of times the script is called). 
    The behavior is the same whether the model is a UI model or a standard Salesforce object model. </contents>
            </template>
            <grid uniqueid="sk-14kltc-257">
                <divisions>
                    <division behavior="flex" minwidth="100px" ratio="1">
                        <components>
                            <buttonset model="UI" uniqueid="sk-s67UV-252">
                                <buttons>
                                    <button type="multi" label="Add a row to UI model" uniqueid="sk-14gpw_-151">
                                        <actions>
                                            <action type="createRow" model="UI" appendorprepend="prepend" defaultmodefornewitems="edit" affectedrows="context">
                                                <defaults/>
                                            </action>
                                        </actions>
                                    </button>
                                </buttons>
                            </buttonset>
                            <queue model="UI" tagrendertype="template" searchbox="true" tokenizesearch="true" showsearchbydefault="true" uniqueid="sk-s423n-94" title="UI Model">
                                <rendertemplate> {{Id}} {{Name}}</rendertemplate>
                                <interactions>
                                    <interaction type="tap">
                                        <action type="custom" snippet="newSnippet"/>
                                    </interaction>
                                </interactions>
                            </queue>
                        </components>
                    </division>
                    <division behavior="flex" verticalalign="top" minwidth="100px" ratio="1">
                        <components>
                            <buttonset model="Acc" uniqueid="sk-14krWh-272">
                                <buttons>
                                    <button type="multi" label="Add row to Account model" uniqueid="sk-14krs6-275">
                                        <actions>
                                            <action type="createRow" model="Acc" appendorprepend="prepend" defaultmodefornewitems="edit" affectedrows="context">
                                                <models>
                                                    <model>Acc</model>
                                                </models>
                                            </action>
                                        </actions>
                                    </button>
                                </buttons>
                            </buttonset>
                            <queue model="Acc" tagrendertype="template" searchbox="true" tokenizesearch="true" showsearchbydefault="true" uniqueid="sk-14khhJ-250" title="Account Model">
                                <rendertemplate>{{Name}} {{Id}}</rendertemplate>
                                <interactions>
                                    <interaction type="tap">
                                        <action type="custom" querystring="id={{Id}}" snippet="newSnippet"/>
                                    </interaction>
                                </interactions>
                            </queue>
                        </components>
                    </division>
                </divisions>
                <styles>
                    <styleitem type="background" bgtype="none"/>
                </styles>
            </grid>
        </components>
        <resources>
            <labels/>
            <javascript>
                <jsitem location="inlinesnippet" name="newSnippet" cachelocation="false">console.log("log a click");</jsitem>
            </javascript>
            <css/>
        </resources>
        <styles>
            <styleitem type="background" bgtype="none"/>
        </styles>
    </skuidpage>
           
Sign In or Register to comment.