Conditional Rendering Model Property Number of Rows Regression (Banzai 7.12)

  • 1
  • Problem
  • Updated 3 years ago
  • Solved
  • (Edited)
When conditional rendering based on model property number of rows is applied to a component, the rendered result is incorrect.

This appears to be a regression of https://community.skuidify.com/skuid/topics/conditional-rendering-model-property-number-of-rows-issu..... 

Steps to Reproduce:
1) Create Page using sample xml below
2) Preview page picking account

Expected Result
Templates "Show if RowCount > 0", "Show if RowCount >= 1","Show if RowCount == 1" are displayed

Actual Result
Template "Show if RowCount != 1" is displayed

Note - The sample page below works as expected on 6.8.20

Sample Page XML
<skuidpage unsavedchangeswarning="yes" showsidebar="true" showheader="true" tabtooverride="Account" personalizationmode="server">   <models>      <model id="Account" limit="1" query="true" createrowifnonefound="false" sobject="Account">
         <fields>
            <field id="Name"/>
            <field id="CreatedDate"/>
         </fields>
         <conditions>
            <condition type="param" enclosevalueinquotes="true" operator="=" field="Id" value="id"/>
         </conditions>
         <actions/>
      </model>
   </models>
   <components>
      <pagetitle model="Account" uniqueid="sk-3Zk7mZ-58">
         <maintitle>
            <template>{{Name}}</template>
         </maintitle>
         <subtitle>
            <template>{{Model.label}}</template>
         </subtitle>
         <actions/>
      </pagetitle>
<template multiple="false" uniqueid="sk-3ZkHGo-82" model="Account">
   <contents>Show if RowCount &gt; 0</contents>
   <renderconditions logictype="and">
      <rendercondition type="fieldvalue" enclosevalueinquotes="false" fieldmodel="Account" sourcetype="modelproperty" nosourcerowbehavior="deactivate" sourceproperty="data.length" operator="gt" value="0"/>
   </renderconditions>
</template>
<template multiple="false" uniqueid="sk-3ZkdpN-129" model="Account">
   <contents>Show if RowCount &gt;= 1</contents>
   <renderconditions logictype="and">
      <rendercondition type="fieldvalue" enclosevalueinquotes="false" fieldmodel="Account" sourcetype="modelproperty" nosourcerowbehavior="deactivate" sourceproperty="data.length" operator="gte" value="1"/>
   </renderconditions>
</template>
      <template multiple="false" model="Account" uniqueid="sk-3Zk7mZ-59">
         <contents>Show if RowCount == 1</contents>
         <renderconditions logictype="and">
            <rendercondition type="fieldvalue" operator="=" enclosevalueinquotes="false" fieldmodel="Account" sourcetype="modelproperty" nosourcerowbehavior="deactivate" sourceproperty="data.length" value="1"/>
         </renderconditions>
      </template>
      <template multiple="false" model="Account" uniqueid="sk-3Zk7mZ-60">
         <contents>Show if RowCount != 1</contents>
         <renderconditions logictype="and">
            <rendercondition type="fieldvalue" operator="!=" enclosevalueinquotes="true" fieldmodel="Account" sourcetype="modelproperty" nosourcerowbehavior="deactivate" sourceproperty="data.length" value="1"/>
         </renderconditions>
      </template>
      <template multiple="false" model="Account" uniqueid="sk-3Zk7mZ-61">
         <contents>Row Count = {{$Model.Account.data.length}}</contents>
      </template>
   </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 3 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Thanks Barry - we had identified this issue a week or so ago.  Its on our list. 
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
This will be fixed in Banzai Update 2. The problem was actually unrelated to the issue previously posted --- we introduced some enhancements around the ability to navigate into Array data via skuid.utils.getObjectProperty() that were necessary for External Data support that were the root cause of the issue here (probably TMI, but I figured Barry you'd appreciate it :)
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb
You know me well, definitely appreciated :)  Thanks Zach!
Photo of Barry Schnell

Barry Schnell, Champion

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