Queue does not conditionally render as data changes in model when using Model Property condition

  • 1
  • Problem
  • Updated 2 years ago
  • Solved
This is based on findings of Andrew N from https://community.skuid.com/skuid/topics/automatically-refresh-render-conditions-on-component?utm_so....

When a queue has a render condition of "Model Property" set to "Has Data Rows", the queue does not update it's visibility as data in the model changes.

Notes
1) Using Brooklyn 9.3.1
2) When the queue is hidden, using the render API on the component does not redraw the component
3) If the queue is visible and you call the render API on it, the editor-contents is removed but the queue header remains.

Steps to reproduce:

1) Create page using XML below
2) Preview page
3) Click "Empty Accounts" button

Expected Behavior = Actual Behavior
Queue and table are removed from page

4) Click "Load Accounts"

Expected Behavior
Queue and Table are visible

Actual Behavior
Queue is not visible, table is

5) In page composer, set "Accounts" model to NOT "Load Model data on page load" and save
6) Preview

Expected Behavior = Actual Behavior
Queue and Table are NOT visible

7) Click "Load Accounts"

Expected Behavior
Queue and Table are visible

Actual Behavior
Queue is NOT visible, table is

Sample Page XML
<skuidpage unsavedchangeswarning="yes" personalizationmode="server" useviewportmeta="true" showsidebar="true" showheader="true" tabtooverride="Account">
    <models>
        <model id="Account" limit="100" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Account" type="">
            <fields>
                <field id="Name"/>
                <field id="CreatedDate"/>
            </fields>
            <conditions/>
            <actions/>
        </model>
    </models>
    <components>
        <pagetitle model="Account" uniqueid="sk-2MgEto-87">
            <maintitle>
                <template>{{Model.labelPlural}}</template>
            </maintitle>
            <subtitle>
                <template>Home</template>
            </subtitle>
            <actions>
                <action type="multi" label="Load Accounts">
                    <actions>
                        <action type="requeryModels" behavior="standard">
                            <models>
                                <model>Account</model>
                            </models>
                        </action>
                    </actions>
                </action>
                <action type="multi" label="Empty Accounts">
                    <actions>
                        <action type="emptyModelData">
                            <models>
                                <model>Account</model>
                            </models>
                        </action>
                    </actions>
                </action>
                <action type="multi" label="Add New Record to Accounts">
                    <actions>
                        <action type="createRow" model="Account" appendorprepend="prepend" defaultmodefornewitems="edit" affectedrows="all"/>
                    </actions>
                </action>
            </actions>
        </pagetitle>
        <grid uniqueid="sk-2OuP5_-111">
            <divisions>
                <division behavior="flex" minwidth="100px" ratio="1">
                    <components>
                        <queue tagrendertype="template" searchbox="true" tokenizesearch="true" showsearchbydefault="true" uniqueid="sk-2MgHYI-106" model="Account" title="Accounts">
                            <rendertemplate>{{Name}}</rendertemplate>
                            <interactions>
                                <interaction type="tap">
                                    <action type="updateIncludePanel" querystring="id={{Id}}"/>
                                </interaction>
                            </interactions>
                            <renderconditions logictype="and">
                                <rendercondition type="fieldvalue" enclosevalueinquotes="true" fieldmodel="Account" sourcetype="modelproperty" nosourcerowbehavior="deactivate" sourceproperty="hasRows"/>
                            </renderconditions>
                        </queue>
                    </components>
                </division>
                <division behavior="flex" verticalalign="top" minwidth="100px" ratio="1">
                    <components>
                        <skootable showconditions="true" showsavecancel="false" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" createrecords="true" model="Account" mode="read" allowcolumnreordering="true" uniqueid="sk-2MgEto-88">
                            <fields>
                                <field id="Name" hideable="true" allowordering="true" uniqueid="fi-2MgE0P-399" valuehalign="" type=""/>
                            </fields>
                            <rowactions/>
                            <massactions usefirstitemasdefault="true"/>
                            <views>
                                <view type="standard"/>
                            </views>
                            <renderconditions logictype="and">
                                <rendercondition type="fieldvalue" enclosevalueinquotes="true" fieldmodel="Account" sourcetype="modelproperty" nosourcerowbehavior="deactivate" sourceproperty="hasRows"/>
                            </renderconditions>
                        </skootable>
                    </components>
                </division>
            </divisions>
            <styles>
                <styleitem type="background" bgtype="none"/>
            </styles>
        </grid>
    </components>
    <resources>
        <labels/>
        <css/>
        <javascript/>
    </resources>
    <styles>
        <styleitem type="background" bgtype="none"/>
    </styles>
</skuidpage>
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb

Posted 2 years ago

  • 1
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
Barry, with your XML I have been able to reproduce the problem you are experiencing and have notified the developers of this issue. I will update this post when a future release addressing this bug is available. Thanks for alerting us of this bug and helping make Skuid better!

A workaround for this is to instead set up the conditional rendering on a wrapper that encloses the Queue component.
(Edited)
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb
Thanks Mark!
Photo of Khamla Phimmachack

Khamla Phimmachack, Official Rep

  • 1,536 Points 1k badge 2x thumb
Hi Barry,

Thanks for your patience as we addressed this bug. This issue has been resolved in the Brooklyn Iteration 5 and Brooklyn Update 1-Iteration 4 release which are now available from 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.

Thanks!
(Edited)
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb
Tested and confirmed as resolved with 9.5.4.  Thank you!