"Cannot read property '0' of undefined" javascript exception during popup display

  • 1
  • Problem
  • Updated 3 years ago
  • Solved
When a popup is displayed in the model event 'new row created', a javascript exception "cannot read property '0' of undefined" is encountered.

Notes
1) The popup is triggered when a "new row" is added to model
2) if the model is marked to "process client side" the exception is NOT encountered
3) Removing the field editor from the popup leaving only the page title, and the popup properly displays without encountering an exception

Steps to reproduce:
1) Create page using XML below
2) Preview page

Expected Behavior
Popup displays

Actual Behavior
Javascript exception encountered





Sample Page XML
<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" showheader="true" tabtooverride="Account">   <models>
      <model id="Account" limit="1" query="false" createrowifnonefound="true" sobject="Account" adapter="" type="" doclone="" processonclient="false">
         <fields>
            <field id="Name"/>
            <field id="CreatedDate"/>
         </fields>
         <conditions/>
         <actions>
            <action>
               <actions>
                  <action type="showPopup">
                     <popup title="New Popup" width="90%">
                        <components>
                           <pagetitle model="Account" uniqueid="sk-2rU-Jx-105">
                              <maintitle>
                                 <template>{{Name}}</template>
                              </maintitle>
                              <subtitle>
                                 <template>{{Model.label}}</template>
                              </subtitle>
                              <actions/>
                              <conditions>
                                 <condition type="contextrow" field="Id" mergefield="Id" operator="="/>
                              </conditions>
                           </pagetitle>
                           <basicfieldeditor showheader="true" showsavecancel="true" showerrorsinline="true" model="Account" buttonposition="" uniqueid="sk-2rVuwQ-150" mode="read">
                              <columns>
                                 <column width="100%">
                                    <sections>
                                       <section title="Section A" collapsible="no">
                                          <fields>
                                             <field id="Name"/>
                                          </fields>
                                       </section>
                                    </sections>
                                 </column>
                              </columns>
                              <conditions>
                                 <condition type="contextrow" field="Id" mergefield="Id" operator="="/>
                              </conditions>
                           </basicfieldeditor>
                        </components>
                     </popup>
                  </action>
               </actions>
               <events>
                  <event>row.created</event>
               </events>
            </action>
         </actions>
      </model>
   </models>
   <components>
      <pagetitle model="Account" uniqueid="sk-2rUqTJ-68">
         <maintitle>
            <template>{{Name}}</template>
         </maintitle>
         <subtitle>
            <template>{{Model.label}}</template>
         </subtitle>
         <actions>
            <action type="savecancel" window="self"/>
         </actions>
      </pagetitle>
      <basicfieldeditor showsavecancel="false" showheader="true" model="Account" mode="read" uniqueid="sk-2rUqTK-69" buttonposition="" layout="">
         <columns>
            <column width="50%">
               <sections>
                  <section title="Basics">
                     <fields>
                        <field id="Name"/>
                     </fields>
                  </section>
               </sections>
            </column>
            <column width="50%">
               <sections>
                  <section title="System Info">
                     <fields>
                        <field id="CreatedDate"/>
                     </fields>
                  </section>
               </sections>
            </column>
         </columns>
      </basicfieldeditor>
   </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 mB Pat Vachon

mB Pat Vachon, Champion

  • 42,704 Points 20k badge 2x thumb
Barry "Steps to Reproduce" Schnell
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
And in this case,  the steps were pretty minimal... 

Thanks for the report Barry - we'll look into this. 
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb
Thanks Rob!
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Barry.  We've identified this issue and it should be fixed in the next update.  (Which is coming very soon)
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb
Awesome news, thank you!
Photo of Ben Hubbard

Ben Hubbard, Employee

  • 12,470 Points 10k badge 2x thumb
This should be fixed in Banzai Update 5. Available from the http://skuidify.com/skuidreleases page.
Photo of Barry Schnell

Barry Schnell, Champion

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