Defect/Issue Description:
I started to notice a defect for UI Picklists that pull their source from snippets. I believe this may have been introduced in the Dubai Update? I was able to reliably reproduce this on any UI only picklist with source with a snippet. If the snippet just contains a console.log(“test”) message, it will fire that snippet twice when the skuid page is rendered. This is particularly a problem if we are using a fetch or API request to source the Picklist and return it as an array. The fetch request fires twice.
I was able to workaround this issue by making the snippet inline (fire on page render) that creates rows in a model that then the UI Only Picklist values.
*Environment: Sandbox
- API Version: v2
- Release: Dubai Update 2
- Release version: 15.2.4.0
- Platform: SFX
Brief Summary of the Defect/Issue:
Adding a UI Only Picklist that is sourced by a snippet; fires that snippet twice when the page loads.
Action Performed:
Load skuid page and review dev tools & console.
Expected Result:
The snippet should only fire once and display “test” only once.
Actual Result:
The snippet fires twice which causes issues if we are making callouts to other resources to populate the picklist.
Additional Resources:
Page XML below:
<skuid__page unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" showheader="true">
<models>
<model id="TestModel" limit="20" query="true" createrowifnonefound="true" datasource="Ui-Only">
<fields>
<field id="TestPickList" displaytype="PICKLIST" length="255" ogdisplaytype="TEXT" picklistsource="snippet" returntype="TEXT" snippet="newSnippet"/>
</fields>
<conditions/>
<actions/>
</model>
</models>
<components/>
<resources>
<labels/>
<javascript>
<jsitem location="inlinesnippet" name="newSnippet" cachelocation="false">console.log("test");</jsitem>
</javascript>
<css/>
<actionsequences/>
</resources>
<styles>
<styleitem type="background" bgtype="none"/>
</styles>
</skuid__page>