Conditional Rendering Model Property number of rows issue

Barry SchnellBarry Schnell 💎💎
edited March 2, 2017 in Questions
The new conditional rendering features added to the Dreamforce release are killer, thank you!

Came across an issue related to the proper evaluation of a conditional rendering property marked to number of rows in model.  In appears that the evaluation is using === / !== and unfortunately the data types are different (data.length is numeric while the value from the xml is string).  This results in incorrect evaluation.

Steps to reproduce:
1) Create a new detail page for Account
2) Remove everything except page title
3) Add 3 templates
- First template with text "Show if RowCount == 1" set to conditionally render when # of rows in Account equals 1
- Second template with text "Show if RowCount != 1" set to conditionally render when # of rows in Account does not equal 1
- Third template with text "{{$Model.Account.data.length}}"
4) Preview the page picking an account when prompted

Actual Result
Template #2 appears

Expected Result
Template #1 appears

Repro Page
<skuidpage unsavedchangeswarning="yes" showsidebar="true" showheader="true" tabtooverride="Account">   <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">
         <maintitle>
            <template>{{Name}}</template>
         </maintitle>
         <subtitle>
            <template>{{Model.label}}</template>
         </subtitle>
         <actions/>
      </pagetitle>
      <template multiple="false" model="Account">
         <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">
         <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">
         <contents>Row Count = {{$Model.Account.data.length}}</contents>
      </template>
   </components>
   <resources>
      <labels/>
      <css/>
      <javascript/>
   </resources>
</skuidpage>

Comments

  • Rob HatchRob Hatch 💎💎💎
    edited September 1, 2016
    Thanks Barry. We've  recreated the error and will work to fix as soon as we can.  As usual - appreciate how thorough your bug reports are. 
  • Zach McElrathZach McElrath Principal Software Engineer Chattanooga, TN 💎💎💎
    edited March 2, 2017
    The issue has been resolved in the upcoming Skuid Winter 15 release, we'll see if we can get this into an upcoming patch of Skuid Summer 14.
  • Barry SchnellBarry Schnell 💎💎
    edited February 25, 2017
    Lightening fast as always, thanks Zach!
  • Barry SchnellBarry Schnell 💎💎
    edited February 25, 2017
    Hi guys - This appears to still be an issue with 6.8.7.  Any updates?
  • edited March 1, 2017
    Not sure if this was ever fixed or if it was a regression, but it has been fixed now.  It will be available in the next patch release.
  • Barry SchnellBarry Schnell 💎💎
    edited November 18, 2016
    Awesome, thanks Ben!
  • edited March 1, 2017
    This has been fixed in Skuid 6.8.8 available on the Skuid Releases page.

    http://www.skuidify.com/skuidreleases

    Let me know if this resolves the issue.
  • Barry SchnellBarry Schnell 💎💎
    edited November 18, 2016
    Tested and confirmed with 6.8.8.  Thanks Ben!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!