0

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?

EricP.
  • 489
  • 3
  • 21
  • Do you open a new page inside PXLongOperation? – RuslanDev Jan 20 '17 at 20:04
  • If i understand correctly: page 1 opens page 2... make changes on page 2 and press save... and you want page 1 to automatically refresh? – Brendan Jan 20 '17 at 20:13
  • Ruslan, I open the new page using PXRedirectRequiredException(graph, true, "message") to get the page in a new tab. Brendan, when page 2 opens, I update a value on page 1 and require that page to reflect the value change. Basically I reset a field, x, back to 0 as well as adjust another field, y, to y += x. The user needs to see that change. – EricP. Jan 23 '17 at 13:38

1 Answers1

1

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);
    }
Brendan
  • 5,428
  • 2
  • 17
  • 33
  • That's actually a good idea. They don't need to do much with the page that is being popped up other than confirm everything made, take off hold and release the item. I'll go ahead and run this idea across the customer and see if they agree. Thank you! – EricP. Jan 24 '17 at 15:57
  • you are welcome. It also helps keep the pages together for the user (no need to flip between tabs and/or windows. – Brendan Jan 24 '17 at 16:32