Conditional rendering in drawer not respecting context (Banzai RC5)

  • 1
  • Problem
  • Updated 3 years ago
  • Solved
See https://community.skuidify.com/skuid/topics/conditional-rendering-not-updating-ui-for-rows-created-a... for some background on this.

When a button in a page title in a drawer has conditional rendering applied, the conditional rendering is not being applied to the row in context during evaluation.

Steps to Reproduce:
1) Create blank page
2) Add Account model specifying "Load model data on page load" = false and "Create default row if Model has none" = false and including Name field
3) Add Contact model specifying "Load model data on page load" = false and "Create default row if Model has none" = false and including Name, First Name and Last Name fields
4) Add table for account including name field
5) Add Drawer row action
6) Inside of drawer add page title specifying context to accountid of row in context
7) Add button to page title with run multiple actions and "create new row in contact"
8) Add a button to page title with run multiple actions and "show message & block ui".  Set conditional rendering to the following:
- LastName != null
- Contact Model has data rows
9) Inside of drawer add field editor specifying context to accountid of row in context and including Name, FirstName & LastName
10) Preview page
11) Click "+" to add new account row
12) Expand newly created row using wand
13) Click "Create Row" in page title within drawer
14) Type a value in Last Name

Expected Result = Actual Result - "Show Message" button appears

15) Remove value from Last Name

Expected Result = Actual Result - "Show Message" button disappears


16) Click "+" to add a new account row
17) Expand newly created row using wand
18) Click "Create Row" in page title within drawer (from most recently added row)
19) Type a value in Last Name of row from #18

Expected Result: "Show Message" button appears
Actual Result: "Show Message" does not appear

20) Remove value from Last Name
21) Type value in Last Name field of Contact from #13

Expected Result: Show Message appears in row from #13
Actual Result: Show message appears in row from #18 and does not appear on row from #13


Sample Page XML
<skuidpage unsavedchangeswarning="yes" showsidebar="true" showheader="true" tabtooverride="Account" personalizationmode="server">   <models>
      <model id="Account" limit="1" query="false" createrowifnonefound="false" sobject="Account" type="" adapter="">
         <fields>
            <field id="Name"/>
         </fields>
         <conditions/>
         <actions/>
      </model>
      <model id="Contact" limit="20" query="false" createrowifnonefound="false" adapter="" type="" sobject="Contact">
         <fields>
            <field id="FirstName"/>
            <field id="Name"/>
            <field id="LastName"/>
         </fields>
         <conditions>
            <condition type="modelmerge" value="" field="AccountId" operator="=" model="Account" enclosevalueinquotes="true" mergefield="Id" novaluebehavior="deactivate"/>
         </conditions>
         <actions/>
      </model>
   </models>
   <components>
      <skootable showconditions="true" showsavecancel="false" showerrorsinline="true" searchmethod="server" searchbox="false" showexportbuttons="false" pagesize="10" createrecords="true" model="Account" buttonposition="" mode="read" uniqueid="sk-2Pc4hF-116" emptysearchbehavior="query">
         <fields>
            <field id="Name"/>
         </fields>
         <rowactions>
            <action type="drawer" label="View Details" icon="sk-icon-magic">
               <drawer title="Drawer Area" width="90%" closehandle="true">
                  <components>
                     <pagetitle model="Contact" uniqueid="sk-2PZ5ph-625">
                        <maintitle>{{Name}}</maintitle>
                        <subtitle>
                           <template>{{Model.labelPlural}}</template>
                        </subtitle>
                        <actions>
                           <action type="multi" label="Create Row">
                              <actions>
                                 <action type="createRow" model="Contact" appendorprepend="prepend" defaultmodefornewitems="edit"/>
                              </actions>
                           </action>
                           <action type="multi" label="Show Message">
                              <actions>
                                 <action type="blockUI" message="Hi there!" timeout="500">
                                    <models>
                                       <model>Contact</model>
                                    </models>
                                 </action>
                              </actions>
                              <renderconditions logictype="and">
                                 <rendercondition type="blank" operator="!=" fieldmodel="Contact" sourcetype="fieldvalue" field="LastName" value="null" enclosevalueinquotes="false" nosourcerowbehavior="deactivate"/>
                                 <rendercondition type="fieldvalue" enclosevalueinquotes="true" fieldmodel="Contact" sourcetype="modelproperty" sourceproperty="hasRows"/>
                              </renderconditions>
                              <enableconditions logictype="and"/>
                           </action>
                        </actions>
                        <conditions>
                           <condition type="contextrow" field="AccountId" mergefield="Id" operator="="/>
                        </conditions>
                     </pagetitle>
                     <basicfieldeditor showsavecancel="false" showheader="true" model="Contact" mode="edit" uniqueid="sk-2PZ5ph-63" buttonposition="">
                        <columns>
                           <column width="100%">
                              <sections>
                                 <section title="Basics" collapsible="no">
                                    <fields>
                                       <field id="Name"/>
                                       <field id="FirstName"/>
                                       <field id="LastName"/>
                                    </fields>
                                 </section>
                              </sections>
                           </column>
                        </columns>
                        <conditions>
                           <condition type="contextrow" field="AccountId" mergefield="Id" operator="="/>
                        </conditions>
                     </basicfieldeditor>
                  </components>
               </drawer>
               <renderconditions logictype="and"/>
            </action>
         </rowactions>
         <massactions usefirstitemasdefault="true"/>
         <views>
            <view type="standard"/>
         </views>
         <searchfields/>
      </skootable>
   </components>
   <resources>
      <labels/>
      <css/>
      <javascript/>
   </resources>
   <styles>
      <styleitem type="background" bgtype="none"/>
   </styles>
</skuidpage>
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,086 Points 10k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Thanks Barry.  We'll be tracking this. 
Photo of J.

J., Official Rep

  • 7,470 Points 5k badge 2x thumb
Hey, Barry. This is fixed as of Skuid Banzai Update 3 (7.17+). 
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,086 Points 10k badge 2x thumb
Sweet, thanks J!
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,086 Points 10k badge 2x thumb
Tested and confirmed with 7.19.  Thank you!