Template Field popup "mode" and "click" rendering issues

Barry SchnellBarry Schnell 💎💎
edited June 25 in Problems
Hello -

Easier to see in action that try to describe in written form.  In summary, when using a custom template popup the popup opens in read mode on subsequent invocations.  Also, the template field itself becomes "single clickable" instead of requiring a double click to open the popup.

Steps to reproduce:
1) Create new page from XML below
2) Attempt to single click either the "Name - Default Popup" or "Name - Custom Popup" field.  Expected Result is encountered, single click does nothing on either field
3) Double click the "Name - Default Popup" field or click the pencil for the field
4) Dismiss the dialog with "Done" or "X"
5) Hover over the "Name - Default Popup" field and you will notice the cursor pointer.  Single click the field and the popup will appear.  Note that the popup is in edit mode.

Actual Result:
Field "edit" can be triggered via single click

Expected Result:
Field Requires double click same as on initial display

6) Dismiss the "Name - Default Popup" dialog via "Done" or "X"
7) Hover over the "Name - Custom Popup" field and you will notice cursor pointer.  Single click the field and the popup will appear.  Note that the popup is in read mode.

Actual Result:
a) Field "edit" can be triggered via single click;
b) Popup is in "read" mode

Expected Result: 
a) Field Requires double click same as on initial display
b) Popup should be in edit mode

Notes/Analysis
1) For custom popups, it appears the dialog is not being destroyed on close (dialog is destroyed on default popup) and hence not rebuilt/re-rendered on subsequent invocations
2) If the pencil edit icon is clicked in Step #7 instead, the dialog displays in edit mode as expected.  The problems described above revolve around the "single click" on the field (and the dialog not getting destroyed)
3) For the single click behavior, after the first time edit mode is invoked, click events are registered and mouse pointer set.  The challenge here is two-fold: 1) The behavior is different for the user the first time and subsequent times; and 2) if the template contains hyperlinked information (e.g. reference field), depending on where they single click, they could go to another object or trigger the edit dialog.

Suggested Solution :)
1) Destroy popup on close for custompopup or ensure components are re-rendered in edit mode on open
2) Remove the click event handler and mouse pointer on the field element so that behavior 1st time and subsequent times is consistent and to avoid confusion with other hyperlinked items in the template field.

Sample 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>
      <basicfieldeditor showsavecancel="false" showheader="true" model="Account" mode="read">
         <columns>
            <column width="100%">
               <sections>
                  <section title="Basics" collapsible="no">
                     <fields>
                        <field id="Name"/>
                        <field type="COMBO" valuehalign="" editmodebehavior="autopopup">
                           <label>Name - Default Popup</label>
                           <template>{{Name}}</template>
                        </field>
                        <field type="COMBO" valuehalign="" editmodebehavior="custompopup">
                           <label>Name - Custom Popup</label>
                           <template>{{Name}}</template>
                           <editmodepopup title="Template Field" width="450">
                              <components>
                                 <basicfieldeditor showsavecancel="false" mode="edit" model="Account">
                                    <columns>
                                       <column width="100%">
                                          <sections>
                                             <section title="">
                                                <fields>
                                                   <field id="Name"/>
                                                </fields>
                                             </section>
                                          </sections>
                                       </column>
                                    </columns>
                                 </basicfieldeditor>
                              </components>
                           </editmodepopup>
                        </field>
                     </fields>
                  </section>
               </sections>
            </column>
         </columns>
      </basicfieldeditor>
   </components>
   <resources>
      <labels/>
      <css/>
      <javascript/>
   </resources>
</skuidpage>


Comments

Sign In or Register to comment.