Skip to main content

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.

I didn’t add event listener. That was error that was generated on multiple . Mistype . Sorry for confusion.


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. 


Thanks Mark, In my page I have a UI block.


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.



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>&amp;lt;ol&amp;gt;Steps to reproduce issue:
&amp;lt;li&amp;gt;Open browser JS console&#46;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Click button to "Add a row to UI model" a few times&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Click each newly created row in the Queue&#46; An Interaction will run a snippet that creates a console&#46;log()&#46;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;Observe console for how many console logs are created&amp;lt;/li&amp;gt;
&amp;lt;/ol&amp;gt;
Expected Behavior: One console log should be present for each item clicked on queue
observed Behavior: Several console logs are being created&#46; 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)&#46;
The behavior is the same whether the model is a UI model or a standard Salesforce object model&#46; </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&#46;log("log a click");</jsitem>
</javascript>
<css/>
</resources>
<styles>
<styleitem type="background" bgtype="none"/>
</styles>
</skuidpage>

Mark,

Thanks for continuing to follow through.
Yes, it does appear to be two distinct issues that are surfacing in similar ways.


will do. I had started one a while back https://community.skuid.com/t/multiple-clicks-on-queue-item-causes-multiple-instances-of-… but I will  use your code and see what happens!


Sorry to have distracted to have piggybacked on your thread. (I still am learning a lot though so, I appreciate it).


Running 11.1.6 the shared code only runs ones click.


No worries! The more the merrier.


Hi Matt,

Thank you for your patience! Skuid has fixed this issue in the Brooklyn 10.0.21 release which is now available on the Skuid Releases page.

As a reminder, Salesforce does NOT allow reverting back to prior versions of managed packages. Skuid always recommends installing new versions in a non-business critical sandbox environment to test all mission critical functionality before installing into a production environment. We also recommend that you update out of date themes when you upgrade. Please let us know if you continue to encounter any problems with this issue after upgrading.


Reply