Saleslogix/argos-saleslogix

Close view without cycling back through history?

RyanFarley opened this issue · 3 comments

Is there a way to simply close a view without using ReUI.back() to cycle back through history? I am loading a page in an iframe (using link_view). The problem is that the page I am loading is an ASP.NET page doing many postbacks. So, the issue is that when I click back, it cycles back through the history (however many times the postback occured) until the view finally closes.
Is there a way for me to simply close the view and be back at where I was before it opened?

You can show a view and trim it from history. The code that handles this is in the base view in argos-sdk:

https://github.com/Saleslogix/argos-sdk/blob/develop/src/View.js#L544-L562

Examples of it being used:

https://github.com/Saleslogix/argos-saleslogix/blob/develop/src/Views/Activity/Complete.js#L491
https://github.com/Saleslogix/argos-saleslogix/blob/develop/src/Views/Activity/Edit.js#L193

I think the problem with this approach is that your IFRAME will insert N number of records into the history stack. You could try extending the window.ReUI.back() we use. We no longer use ReUI, but we shimmed that function in the SDK App:

https://github.com/Saleslogix/argos-sdk/blob/develop/src/Application.js#L70-L104

Alternatively, you could put a return link above the IFRAME that says "Go Back To List" or something similar.

That is excellent, I will take a look. Thanks Jason.