Skip to main content

When a row action is configured with conditional rendering, on initial page display if the condition is TRUE, the action is not displayed.


Steps to reproduce:


  1. Create page from XML below

  2. Preview page

Expected Behavior

“Flag for delete” row action should be visible


Actual Behavior

“Flag for delete” is not visible


Notes:


  1. When configuring the global action “My Global Action” with the same condition, it displays as expected

  2. If you change the condition on the row action to “!=‘Bar’” the row action appears on initial page display

Sample Page XML


<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" showheader="true" tabtooverride="Account">   <models>
<model id="Account" limit="100" query="true" createrowifnonefound="false" sobject="Account" adapter="" type="">
<fields>
<field id="Name"/>
<field id="CreatedDate"/>
</fields>
<conditions/>
<actions/>
</model>
<model id="Tracker" limit="1" query="false" createrowifnonefound="true" adapter="" type="" sobject="Account">
<fields>
<field id="Mode" uionly="true" displaytype="TEXT" label="Mode" defaultValue="Bar"/>
</fields>
<conditions/>
<actions/>
</model>
</models>
<components>
<pagetitle model="Account" uniqueid="sk-2Q5m2_-66">
<maintitle>Mode Is {{$Model.Tracker.data.0.Mode}}</maintitle>
<subtitle>
<template>Home</template>
</subtitle>
<actions>
<action type="multi" label="Update to Foo">
<actions>
<action type="updateRow" fieldmodel="Tracker" field="Mode" enclosevalueinquotes="true" value="Foo"/>
</actions>
</action>
<action type="multi" label="Update to Bar">
<actions>
<action type="updateRow" fieldmodel="Tracker" field="Mode" enclosevalueinquotes="true" value="Bar"/>
</actions>
</action>
</actions>
</pagetitle>
<skootable showconditions="true" showsavecancel="false" searchmethod="server" searchbox="false" showexportbuttons="false" pagesize="10" createrecords="false" model="Account" mode="edit" uniqueid="sk-2Q5m2_-67" emptysearchbehavior="query">
<fields>
<field id="Name" allowordering="true" valuehalign="" type=""/>
<field id="CreatedDate" allowordering="true" valuehalign="" type=""/>
</fields>
<rowactions>
<action type="delete">
<renderconditions logictype="and">
<rendercondition type="fieldvalue" operator="=" enclosevalueinquotes="true" fieldmodel="Tracker" sourcetype="fieldvalue" nosourcerowbehavior="skipandnorender" field="Mode" value="Bar"/>
</renderconditions>
</action>
</rowactions>
<massactions usefirstitemasdefault="true"/>
<views>
<view type="standard"/>
</views>
<actions defaultlabel="Global Actions" defaulticon="sk-icon-magic" usefirstitemasdefault="true">
<action type="multi" label="My Global Action" icon="sk-icon-magic">
<renderconditions logictype="and">
<rendercondition type="fieldvalue" operator="=" enclosevalueinquotes="true" fieldmodel="Tracker" sourcetype="fieldvalue" nosourcerowbehavior="skipandnorender" field="Mode" value="Bar"/>
</renderconditions>
<actions/>
</action>
</actions>
<searchfields/>
</skootable>
</components>
<resources>
<labels/>
<css/>
<javascript/>
</resources>
<styles>
<styleitem type="background" bgtype="none"/>
</styles>
</skuidpage>

This one took some research.

In the end, the reason you are seeing this behavior is because both of your models are built using the same SObject. Skuid, recognizing that both the referenced model and the context model are built on the same object, is being over-aggressive about optimization and choosing to use the context row (from your table) rather than traversing your other model to get a different row. Obviously, though, it should do a few more checks to make sure that this is appropriate.

If you had built your “Tracker” model on a different SObject, this issue wouldn’t have presented itself.

I’ve logged it in our bug tracker and we’ll address it in a future update.


Thanks JD!


This fix has been made and is scheduled for Banzai Update 9.


Thank you!


This fix is now available from Get the Latest Skuid Releases & Everything That Came Before in either the Banzai Update 9 release or the Rockaway Release.


Tested and confirmed with Skuid 8.8.  Thank you!


Reply