Updating a page include in a popup closes popup

John DahlbergJohn Dahlberg ✭✭✭✭
edited February 4, 2020 in Questions
After upgrading to 11.2.2, when updating a page include rendered within a popup, the popup will close rather than load the content of the desired page.  In our scenario, we have a set of pages to create new records and a set of pages to display record details, where related lists and additional details are included.  After the save of a new record, we reload the page include with the detail page to provide confirmation that the record was saved and provide the user the ability to add related records, attachments, etc.  We are using a simple snippet to perform the update to the page include and the behavior is triggered on the load() function.  This is able to be replicated from the console.  Note that this script works fine when updating includes not in a popup.  Here is the script:

var target = arguments[0],
    content = arguments[1],
    query = arguments[2];
$ = skuid.$;
    var pageInclude = skuid.$('#'+target).data('object');
        pageInclude.pagename = content;
        pageInclude.querystring = query;
        pageInclude.load();



This is invoked by the following URL:
javascript:skuid.snippet.getSnippet('UpdatePageInclude')('NewLead','INTP_LeadDetail','Id={{{Id}}}',);


And here's a sample page where this issue can be observed:

<skuidpage unsavedchangeswarning="yes" personalizationmode="server" useviewportmeta="true" showsidebar="true" showheader="true" tabtooverride="Lead">
    <models>
        <model id="INTP_New_Lead_Lead" limit="1" query="false" createrowifnonefound="true" datasource="salesforce" sobject="Lead" type="">
            <fields>
                <field id="FirstName"/>
                <field id="LastName"/>
                <field id="Company"/>
                <field id="Address"/>
                <field id="City"/>
                <field id="Country"/>
                <field id="CreatedById"/>
                <field id="CreatedBy.Name"/>
                <field id="CreatedDate"/>
                <field id="Description"/>
                <field id="DoNotCall"/>
                <field id="Email"/>
                <field id="HasOptedOutOfEmail"/>
                <field id="Phone"/>
                <field id="RecordTypeId"/>
                <field id="RecordType.Name"/>
                <field id="Street"/>
                <field id="Website"/>
                <field id="PostalCode"/>
                <field id="State"/>
                <field id="Status" overridemetadata="false" ogdisplaytype="PICKLIST" displaytype="PICKLIST" picklistsource="manual">
                    <picklistentries/>
                </field>
            </fields>
            <conditions>
                <condition type="param" value="Owner" field="OwnerId" fieldtargetobjects="Group,User" operator="=" enclosevalueinquotes="true" novaluebehavior=""/>
            </conditions>
            <actions/>
        </model>
    </models>
    <components>
        <grid uniqueid="sk-qSN0o-238">
            <divisions>
                <division behavior="flex" minwidth="60%" ratio="1" verticalalign="top">
                    <components>
                        <basicfieldeditor showsavecancel="false" showheader="true" model="INTP_New_Lead_Lead" mode="edit" uniqueid="sk-26rXP5-95" buttonposition="">
                            <columns>
                                <column width="100%">
                                    <sections>
                                        <section title="Basics" collapsible="no" showheader="false">
                                            <fields>
                                                <field id="FirstName" uniqueid="sk-26rXOl-88" valuehalign="" type=""/> <field id="LastName" uniqueid="sk-26rXOr-90" valuehalign="" type=""/>
                                                <field uniqueid="sk-tQTRR-265" id="Company" showhelp="true" valuehalign="" type=""/> <field uniqueid="sk-qTu2X-520" id="RecordTypeId" showhelp="true" valuehalign="" type="REFPICK" optionsource="" pagesize="5" redirecttype="datasourcedefault">
                                                <searchfields/>
                                                <label>Record Type</label>
                                            </field>
                                            <field uniqueid="sk-tQUo9-276" id="Email" showhelp="true" valuehalign="" type=""/>
                                            <field uniqueid="sk-tQVTv-285" id="Phone" showhelp="true" valuehalign="" type=""/>
                                            <field uniqueid="sk-tSJWo-547" id="Status" showhelp="true" valuehalign="" type=""/>
                                        </fields>
                                    </section>
                                </sections>
                            </column>
                        </columns>
                    </basicfieldeditor>
                </components>
            </division>
            <division behavior="flex" verticalalign="top" minwidth="40%" ratio="1">
                <components>
                    <buttonset uniqueid="sk-qSOce-254" model="INTP_New_Lead_Lead">
                        <buttons>
                            <button type="multi" label="Save" uniqueid="sk-qSXuE-331" icon="sk-icon-save">
                                <actions>
                                    <action type="blockUI" message="Saving"/>
                                    <action type="save">
                                        <models>
                                            <model>INTP_New_Lead_Lead</model>
                                        </models>
                                    </action>
                                    <action type="redirect" window="self" url="javascript:skuid.snippet.getSnippet('UpdatePageInclude')('NewLead','INTP_LeadDetail','Id={{{Id}}}',);"/>
                                    <action type="unblockUI"/>
                                </actions>
                            </button>
                            <button type="multi" label="Cancel" uniqueid="sk-qSXw_-335" icon="sk-icon-cancel" secondary="true">
                                <actions>
                                    <action type="cancel">
                                        <models>
                                            <model>INTP_New_Lead_Lead</model>
                                        </models>
                                    </action>
                                    <action type="closeTopmostPopup"/>
                                </actions>
                            </button>
                        </buttons>
                    </buttonset>
                </components>
            </division>
        </divisions>
        <styles>
            <styleitem type="background" bgtype="none"/>
        </styles>
    </grid>
</components>
<resources>
    <labels/>
    <css/>
    <javascript/>
    <actionsequences uniqueid="sk-qTDl4-466"/>
</resources>
<styles>
    <styleitem type="background" bgtype="none"/>
</styles>
</skuidpage>

Comments

  • Mark DeSimoneMark DeSimone 🛠️ 
    edited February 4, 2020
    Hi John, which version did you have before the upgrade?

    I'm trying to use the information you provided to mock up a reproduction of the issue, but I think I'm missing some items, like the page include's own XML, and the snippet that you're referring to in the Go To URL action. I'm also curious about why you're grabbing the snippet via a URL redirect like that - that's not an approach I've seen before. 

    One thing I can say is that the methods you're using to update the page include are undocumented, so they may be subject to changes in behavior without warning. I don't know that this is what's happened - there still may be a product issue unrelated to those snippets that we need to root out. 
  • John DahlbergJohn Dahlberg ✭✭✭✭
    edited July 4, 2018
    Hey Mark,

    We were on 11.0.2 prior to upgrading 11.2.2 (in a full copy sandbox).

    The reason we're using a URL redirect to invoke the snippet is to pass parameters into the snippet.  This allows us to create very generalized functions that can be used across many pages while keeping code to a minimum.  This page include snippet is used in hundreds of spots even though it's only a few lines of code.

    I wrote a post a while back about adding parameters to the Run Snippet Action in the framework here:  https://community.skuid.com/skuid/topics/custom-snippet-parameters-in-action-framework

    The snippet here (the first section of the original post) simply swaps out a page include with another page, similar to what a Queue can be setup to do.  Preferable this would all be done declaratively, but that action isn't available in the action framework outside of the queue component.  It would make me and anyone else doing single page apps a happy camper if it was made available declaratively.   There was a post a while ago that I got the detail on the javascript from:  https://community.skuid.com/skuid/topics/update-page-include-from-table-row-action

    Here's the snippet content (called UpdatePageInclude):

    var target = arguments[0],
        content = arguments[1],
        query = arguments[2];
    $ = skuid.$;
        var pageInclude = skuid.$('#'+target).data('object');
            pageInclude.pagename = content;
            pageInclude.querystring = query;
            pageInclude.load();



    It really doesn't matter what page you use in the update.  Any page will do to recreate the issue.  What I was able to pin down is that the last line --- pageInclude.load(); ---  is the trigger for closing the popup.
  • John DahlbergJohn Dahlberg ✭✭✭✭
    edited July 23, 2018
    Mark - I think this might be helpful for pinpointing the problem.  I setup a page for testing this issue using purely declarative options.  There is a button that loads a popup.  In that popup is a queue that updates a page include within the popup.  When the popup first loads the page include loads the starting page OK.  Selecting a record in the queue causes the popup to close.  Here's the XML for both the test page and the page include:

    Test Page

    <skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" useviewportmeta="true" showheader="true">
        <models>
            <model id="TestUpdateIncludeTask" limit="20" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Task" orderby="CreatedDate DESC">
                <fields>
                    <field id="RecordTypeId"/>
                    <field id="Id"/>
                    <field id="Subject"/>
                </fields>
                <conditions/>
                <actions/>
            </model>
        </models>
        <components>
            <buttonset uniqueid="sk-1buH-214" model="TestUpdateIncludeTask" position="center">
                <buttons>
                    <button type="multi" label="show popup" uniqueid="sk-1buH-221">
                        <actions>
                            <action type="showPopup">
                                <popup title="New Popup" width="90%">
                                    <components>
                                        <grid uniqueid="sk-1gJu-468">
                                            <divisions>
                                                <division behavior="flex" minwidth="20%" ratio="1" verticalalign="top">
                                                    <components>
                                                        <queue model="TestUpdateIncludeTask" tagrendertype="template" searchbox="true" tokenizesearch="true" showsearchbydefault="true" hideheader="false" hidefooter="false" uniqueid="sk-1gJw-492">
                                                            <rendertemplate>{{Subject}}</rendertemplate>
                                                            <interactions>
                                                                <interaction type="tap">
                                                                    <action type="updateIncludePanel" querystring="id={{Id}}" panelid="TaskDetail" pagename="TestTaskDetail"/>
                                                                </interaction>
                                                            </interactions>
                                                        </queue>
                                                    </components>
                                                </division>
                                                <division behavior="flex" verticalalign="top" minwidth="80%" ratio="1">
                                                    <components>
                                                        <includepanel type="skuid" uniqueid="TaskDetail" pagename="TestTaskDetail" querystring="id={{{Id}}}">
                                                            <renderconditions logictype="and"/>
                                                        </includepanel>
                                                    </components>
                                                </division>
                                            </divisions>
                                            <styles>
                                                <styleitem type="background" bgtype="none"/>
                                            </styles>
                                        </grid>
                                    </components>
                                </popup>
                            </action>
                        </actions>
                    </button>
                </buttons>
            </buttonset>
        </components>
        <resources>
            <labels/>
            <javascript/>
            <css/>
            <actionsequences uniqueid="sk-1gJd-348"/>
        </resources>
        <styles>
            <styleitem type="background" bgtype="none"/>
        </styles>
    </skuidpage>






    Here's the page Include:

    <skuidpage unsavedchangeswarning="yes" personalizationmode="server" useviewportmeta="true" showsidebar="true" showheader="true" tabtooverride="Task">
        <models>
            <model id="TestTaskDetailTask" limit="1" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Task">
                <fields>
                    <field id="Subject"/>
                    <field id="CreatedDate"/>
                    <field id="Id"/>
                </fields>
                <conditions>
                    <condition type="param" enclosevalueinquotes="true" operator="=" field="Id" value="id"/>
                </conditions>
                <actions/>
            </model>
        </models>
        <components>
            <pagetitle model="TestTaskDetailTask" uniqueid="sk-1gNi-214">
                <maintitle>
                    <template>{{Subject}}</template>
                </maintitle>
                <subtitle>
                    <template>{{Model.label}}</template>
                </subtitle>
                <actions>
                    <action type="delete" uniqueid="sk-1gNi-203"/>
                    <action type="clone" uniqueid="sk-1gNi-206"/>
                    <action type="share" uniqueid="sk-1gNi-209"/>
                    <action type="savecancel" window="self" uniqueid="sk-1gNi-212"/>
                </actions>
            </pagetitle>
            <basicfieldeditor showsavecancel="false" showheader="true" model="TestTaskDetailTask" mode="read" uniqueid="sk-1gNi-230">
                <columns>
                    <column width="50%">
                        <sections>
                            <section title="Basics">
                                <fields>
                                    <field id="Subject" uniqueid="sk-1gNi-222"/>
                                </fields>
                            </section>
                        </sections>
                    </column>
                    <column width="50%">
                        <sections>
                            <section title="System Info">
                                <fields>
                                    <field id="CreatedDate" uniqueid="sk-1gNi-228"/>
                                </fields>
                            </section>
                        </sections>
                    </column>
                </columns>
            </basicfieldeditor>
        </components>
        <resources>
            <labels/>
            <css/>
            <javascript/>
            <actionsequences uniqueid="sk-1gO3-270"/>
        </resources>
        <styles>
            <styleitem type="background" bgtype="none"/>
        </styles>
    </skuidpage>


  • Mark DeSimoneMark DeSimone 🛠️ 
    edited February 4, 2020
    John, thank you very much for these page includes. This looks to reproduce the underlying issue, without any code or custom objects in the mix, which is perfect for the purpose of submitting as a product issue. I've done so, and will update this post when a fix is available. 
  • edited July 15, 2018
    I am having this issue when using the toggle component action on a page include within a popup.  Toggling the page include from within the popup closes the popup.  Toggling a page include within the main page works fine.  I tested this in a sandbox on v11.2.5.  Below is a very simple model-less test page to illustrate this.  Also, when I was trying to figure out what the issue was, I thought I found the same behavior (toggling a component within the popup closing the whole popup) when toggling a component type other than a page include, but not finding that now and I don't have time to test all the permutations, so just a heads up that it might not be limited to page includes.
    <skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" useviewportmeta="true" showheader="true">     <models/>     <components>         <buttonset uniqueid="sk-2Voy-452">             <buttons>                 <button type="popup" label="Open Popup" uniqueid="sk-2Voy-461">                     <popup title="New Popup" width="90%">                         <components>                             <buttonset uniqueid="sk-2Vp4-533">                                 <buttons>                                     <button type="multi" label="Toggle Page Include in popup" uniqueid="sk-2Vp4-540">                                         <actions>                                             <action type="toggleRenderComponent" behavior="toggle" componentid="pageIncInPopup"/>                                         </actions>                                     </button>                                 </buttons>                             </buttonset>                             <includepanel type="skuid" uniqueid="pageIncInPopup" pagename="testPageInc"/>                         </components>                     </popup>                 </button>             </buttons>         </buttonset>         <buttonset uniqueid="sk-2VtH-256">             <buttons>                 <button type="multi" label="Toggle Page Include on main page" uniqueid="sk-2VtI-263">                     <actions>                         <action type="toggleRenderComponent" behavior="toggle" componentid="pageIncOnMainPage"/>                     </actions>                 </button>             </buttons>         </buttonset>         <includepanel type="skuid" uniqueid="pageIncOnMainPage" pagename="testPageInc"/>     </components>     <resources>         <labels/>         <javascript/>         <css/>         <actionsequences/>     </resources>     <styles>         <styleitem type="background" bgtype="none"/>     </styles> </skuidpage>
  • John DahlbergJohn Dahlberg ✭✭✭✭
    edited July 20, 2018
    Any updates on this?  Looks like others are running into this issue as well:

    https://community.skuid.com/skuid/topics/popup-with-queue-closes-when-item-click-in-queue-11-2-5
  • Jack SanfordJack Sanford San Antonio, TX 💎💎
    edited July 23, 2018
    This reply was created from a merged topic originally titled Popup with queue closes when item click in queue 11.2.5. I have a popup that contains a queue. The queue updates a page include. The page include loads with the option to create a new record by default, then when you click on an item in the queue it loads an existing record into the page include. Everything works fine in an org 11.1.14. In an org running 11.2.5, the popup closes every time the existing record gets loaded into the page include. I've gone through and removed every single action that closes popups on both the page include and the underlying page and it still closes automatically. Any ideas? 
  • Jack SanfordJack Sanford San Antonio, TX 💎💎
    edited July 31, 2018
    Another nuance on this issue - I have a popup that has a page include. On that page is a row action that opens another popup with a page include. Everything works fine, until I close that top popup, it closes all popups, instead of just the topmost popup. If the second popup does not contain a page include, things work fine. 

    Also note that it is not fixed in 11.2.6
  • Mark DeSimoneMark DeSimone 🛠️ 
    edited February 4, 2020

    Thank you for your patience! Skuid has fixed the issue you raised here (issue CORE-1979) in the new 11.2.7 release which is now available on the Skuid Releases page.
    As a reminder, Salesforce does NOT allow reverting back to prior versions of managed packages. Skuid always recommends installing new versions in a non-business critical sandbox environment to test all mission critical functionality before installing into a production environment. We also recommend that you update out of date themes when you upgrade. Please let us know if you continue to encounter any problems with this issue after upgrading. 
    Thanks again for alerting us of these issues! 
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!