Updating a page include in a popup closes popup

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:

Record Type INTP_New_Lead_Lead INTP_New_Lead_Lead

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. 

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:  http://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:  http://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.

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

{{Subject}}

Here’s the page Include:

{{Subject}} {{Model.label}}

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. 

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>

Any updates on this?  Looks like others are running into this issue as well:

http://community.skuid.com/skuid/topics/popup-with-queue-closes-when-item-click-in-queue-11-2-5

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? 

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


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!