Uncaught TypeError: Cannot read property 'mode' of undefined - Read-only Template field inside of a table

  • 1
  • Problem
  • Updated 4 years ago
  • In Progress
When a table contains a drawer that contains a template field marked as read-only, the double-click event is being handled resulting in an "Uncaught TypeError: Cannot read property mode of undefined" exception.

Couple of notes:
1) It appears that the dblclick handler is tracking any nx-field inside of the tbody which is leading to the exception since there is no outer tr in this particular situation.
2)  The exception appears to be benign and page functionality continues as expected but could lead to issue in the future if further processing were ever added to this code path.

Steps to reproduce:
1) Create new page using XML below
2) Preview page
3) Expand drawer for any contact
4) Double-click the value side of the template field

Actual Result:
Uncaught TypeError: Cannot read property 'mode' of undefined and processing halts

Expected Result:
No exception and double-click should not be handled in this situation since the field is not editable.

Sample XML
<skuidpage unsavedchangeswarning="yes" showsidebar="true" showheader="true" tabtooverride="Account">   <models>
      <model id="Contact" limit="" query="true" createrowifnonefound="false" sobject="Contact" doclone="" type="">
         <fields>
            <field id="Id"/>
            <field id="Name"/>
            <field id="FirstName"/>
         </fields>
         <conditions/>
         <actions/>
      </model>
   </models>
   <components>
      <skootable showconditions="true" showsavecancel="false" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" createrecords="true" model="Contact" buttonposition="" mode="read">
         <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>
                     <basicfieldeditor showheader="true" showsavecancel="false" model="Contact" buttonposition="" mode="read" layout="">
                        <columns>
                           <column width="100%">
                              <sections>
                                 <section title="Section A" collapsible="no">
                                    <fields>
                                       <field type="COMBO" valuehalign="" editmodebehavior="autopopup" allowhtml="false" readonly="true">
                                          <label>Template Field</label>
                                          <template>{{FirstName}}</template>
                                       </field>
                                    </fields>
                                 </section>
                              </sections>
                           </column>
                        </columns>
                        <conditions>
                           <condition type="contextrow" field="Id" mergefield="Id"/>
                        </conditions>
                     </basicfieldeditor>
                  </components>
               </drawer>
            </action>
         </rowactions>
         <massactions usefirstitemasdefault="true"/>
         <views>
            <view type="standard"/>
         </views>
      </skootable>
   </components>
   <resources>
      <labels/>
      <css/>
      <javascript/>
   </resources>
</skuidpage>
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb

Posted 4 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Thanks for the detail.  We will review.