Make it possible to close multiple pages from a microflow - Mendix Forum

Make it possible to close multiple pages from a microflow

99

I would like to be able to close multiple pages from a microflow.

This comes in handy when you have for instance a task page with a reject button. When the users presses this button you want to show a popup to ask for a rejection reason. From this popup it is not possible to close both the popup and the task page. There are more situations in which this feature would be nice.

asked
8 answers

I you are unable to close popups (out of reach), you can open an empty popup page at the end of your microflow and include a microflow timer (or datasource) wich closes multiple pages. This popup will be on top of all the other pages, therefore it can close all popups/pages out of reach.

Created

Anyone know a work-around in the meantime? 

Created

You can implement it with Javascript snippet for your specific requirement, I think.

Do not abuse a pop-up window.   Better to use Javascript-popup.

Created

Johan hits the nail on the head:

"It feels to me that this feature request is a wish for something more fundamental: being able to model out the navigation flow through an app."

But I do not completely agree with Johan that this idea in itself is useless or too complicated, in my experience there are usually cases where you just want to be able to use close page twice and are not confused as to what that will do.

Created

If you define this behavior, developers can work within those bounds. My suggestion for an implementation would be to first close the origin form, then proceed to close each layered pop-up starting with the top-most one. At the point where there are no more pop-ups, close the current in-content page, then the next, etc. If the user reaches their home page and has no more pages to close, end there.

Created

This is an idea I've heard before and there are some good use cases for it. However, it is not always easy to determine which pages to close.

Let's say we have a pop-up with a button calling a microflow which tells the client to close the page. Because we keep track of the origin of the microflow call in the client we know which page to close and as a result the pop-up is closed.

Now imagine we have two pop-ups open and the client would get an instruction to close two pages. The first page to close is clear. But which other page to close? The remaining pop-up or the page opened in content? What if there are modal pop-ups open? What if the user is on the home page and actually can't go back multiple pages? You can argue that the last case is a modelling error.

It feels to me that this feature request is a wish for something more fundamental: being able to model out the navigation flow through an app.

 

Created

I have dreamed about this option since I was a little boy...

Created

Absolutely! And it seems to me as a simple addition: just collect all the "close page" actions on the action_list returned to the front-end.

Created