Reputation: 489
I have a custom page in which I am trying to refresh the original page while opening a new page in a separate tab after clicking an action button. To open the new page, I use PXRedirectRequiredException(graph, true, "message"), but this seems to prevent the original page from refreshing to reflect changes after it performs a .PressSave() action.
Any suggestions?
Upvotes: 0
Views: 870
Reputation: 5623
From my findings, you cannot have separately opened pages update and refresh from another. The user will need to manually refresh the other page. We had this same need. What we did was call the 2nd page as a popup within the first page. On the close of the popup page it would return to the main page and refresh the results. One issue we found is you cannot set popup page size as a percentage as it relates to the parent page. The issue is found here here which defines a fixed value size.
Here is a sample from what we used on the sales order page:
public PXAction<SOOrder> MyPopupButton;
[PXButton(OnClosingPopup = PXSpecialButtonType.Refresh, Tooltip = "Launch my page name")]
[PXUIField(DisplayName = "My Button", MapEnableRights = PXCacheRights.Update, MapViewRights = PXCacheRights.Update)]
public virtual void myPopupButton()
{
var graph = PXGraph.CreateInstance<MyGraph>();
graph.Results.Current = graph.Results.Search<MyDac.MyKey>(myView.Current.MyKey);
PXRedirectHelper.TryRedirect(graph, PXRedirectHelper.WindowMode.Popup);
}
Upvotes: 2