Yeah, I believe this is what is happening. In my form I am also submitting an '_eventId' and also in my url, from a previous request, their is also an '_eventId'.
If I do a redirct to strip the url of its '_eventId' then everything works. However, my flow does not work as it suppose to.
When I do a redirect I loose all of my flowScope attributes (used for conidtion logic in jsp) and my form object.
So, I guess my question is how do I do a redirect without loosing these objects? I know you said this is possible, but I don't see it . :cry:
The following is flow snippet:
This is the first state that is entered, determine whether or not a category only view or a category and product view is shown.
Code:
addActionState (ACTION_SELECT_CATEGORY_ID, method ("getSubcategories", actionRef (CatalogAction.class)),
new Transition[] { on ("showOnlyCategories", VIEW_ONLY_CATEGORIES_ID),
on ("showCategoriesAndProducts", VIEW_CATEGORIES_AND_PRODUCTS_ID)});
This is my main view, where depending on the user action, subflows are spawn.
Code:
addViewState (VIEW_ONLY_CATEGORIES_ID, VIEW_ONLY_CATEGORIES,
new Transition[] {on("showCategory", ACTION_SELECT_CATEGORY_ID),
on ("addCategory",ADD_CATEGORY_INLINE),
on ("duplicateCategory", SUB_FLOW_DUPLICATE_CATEGORY),
on ("applyCategory",SUB_FLOW_APPLY_CATEGORY),
on ("updateCategory",SUB_FLOW_UPDATE_CATEGORY),
on ("removeCategory",SUB_FLOW_REMOVE_CATEGORY),
on ("deleteCategory",SUB_FLOW_DELETE_CATEGORY),
on (submit(), BIND_N_VALIDATE)});
The following adds a default category, and set attributes within the flow that will be used
in my jsp page (conditionl ogic) .
On 'success', if I do a redirect I loose my form ojbect and flow scope attributes.
If I just go back to 'ACTION_SELECT_CATEGORY_ID' state, I cannot submit the form because of "double _eventId" problem. I cannot go back to 'VIEW_ONLY_CATEGORIES_ID' state becaue my view will not be updated/refresh.
Code:
addActionState (ADD_CATEGORY_INLINE, method (ADD_CATEGORY_INLINE, actionRef(CategoryFormAction.class)),
new Transition[] {on (success(),UPDATE_INLINE_REDIRECT), on (error(), "error")});
If I do a redirect, then everything is gone
Code:
addEndState (UPDATE_INLINE_REDIRECT, new RedirectViewDescriptorCreator("categoryBrowse.html?select=${flowScope.category}&category=${flowScope.category}&action=${flowScope.action}&method=${flowScope.method}&row=${flowScope.row}"));
I have been struggling with this for a while now, I can't see the solution.
Any ideas?