cancel
Showing results for 
Search instead for 
Did you mean: 

dialog navigation

whippet
Champ in-the-making
Champ in-the-making
Hi,
I was wondering why this is not valid and what an alternative might be:

dialog:close:dialog:close

My current understanding, (which I wouldn't mind a better explanation on) is that by performing dialog:close I remove an item from a stack kept of pages navigated to.


Thanks,
P
5 REPLIES 5

frederick
Champ in-the-making
Champ in-the-making
That code should work correctly, as the AlfrescoNavigationHandler has specific code to handle this statement.

I quickly tried it as follows:
- start in browse screen
- open dialog space details
- from there, open dialog import
- click cancel, where I manually changed the outcome to "dialog:close:dialog:close".
- I was correctly returned to the browse screen instead of the space details screen.

The syntax is "prefixSmiley SurprisedutcomeSmiley Surprisedverride", where override is only considered if outcome is "close".

The override itself can again be "prefix:close", and the navigation handling will restart to process this override.

Note that a dialog:close or wizard:close will only pop a page from the stack if no override is provided. If one is provided, the stack is emptied.
This is a bit strange, as the double dialog:close statement requires the second dialog:close to pop a page, but at that point the stack is already emptied. So in my example, I was returned to the browse screen, but only because the second dialog:close found no page on the stack to return to, and defaulted to "browse".

whippet
Champ in-the-making
Champ in-the-making
Thanks for your response. I have noticed however
dialog:close:dialog:close 
? always take me back to the browse page and not back in sequentially order.
Hence if I navigated 3 or 4 pages away from the browse page it is taking me back to the browse page.

Maybe I am doing something wrong ?

Also can you please give a little explanation as to the syntax being "prefixSmiley SurprisedutcomeSmiley Surprisedverride", where override is only considered if outcome is "close".

Thanks,
W

frederick
Champ in-the-making
Champ in-the-making
Sorry if my post was not clear. What I meant in my last paragraph is that the dialog:close outcome empties the dialog stack if there's an override present. As a consequence, any subsequent dialog:close calls do not work, because they have no dialog to close anymore. The navigation then defaults to browse.

Eg.
"dialog:close:wizard:runAction" will work because wizard:runAction does not need anything from the view stack.
"dialog:close:dialog:close" will always go to browse because (the second) dialog:close needs the previous dialog from the view stack, which is empty by then.

This looks like a bug to me, so you may want to raise it in Jira.

The "prefixSmiley SurprisedutcomeSmiley Surprisedverride" syntax is used by the wizard/dialog framework, and replaces regular outcomes.
- Prefix denotes the type, either 'wizard' or 'dialog'.
- Outcome is the actual outcome, like the name of the dialog or wizard to start, or 'close' to close the current one.
- Override is optional, and is only handled if the outcome was 'close'. It tells the navigationhandler to immediately execute another navigation after the dialog or wizard is closed.

gavinc
Champ in-the-making
Champ in-the-making
I couldn't have answered better myself, in fact in my reply to your other thread i completely missed the fact the dialog framework clears the stack when you have an override Smiley Surprisedops:

Frederick is right though, this case should really be handled and raising a bug as he and I suggested is probably the best course of action.

whippet
Champ in-the-making
Champ in-the-making
Thank you both for you responses and particularly Frederick's meticulous explanation - much appreciated. I will log this as a bug in JIRA.