Hi all,
How can you change your portlet mode in SWF 2.0, preferrably specified in the flow definition? In SWF 1.0, it was possible using the SetPortletModeAction, but I'm not sure if that can be used in SWF 2.
Hi all,
How can you change your portlet mode in SWF 2.0, preferrably specified in the flow definition? In SWF 1.0, it was possible using the SetPortletModeAction, but I'm not sure if that can be used in SWF 2.
You can implement a FlowHandler that changes the portlet model when your flow ends, a common scenario. You can also do it in code by downcasting the external context to a PortletExternalContext for ActionRequests. We could consider making the latter a little easier to do by providing some convenience portletMode setters -- if you can provide more information about your use case, that would be helpful.
Keith Donald
Core Spring Development Team
Thanks for your quick reply, Keith. This solves my problem. I won't discourage you from making the setter-call easier, but I think the current call suffices.
The use case was a form submission, after which the portlet mode should be changed. For other users with a similar problem, the ExternalContext-solution suggested by Keith is included below:
Code:<evaluate expression="externalContext.nativeResponse.setPortletMode(@javax.portlet.PortletMode@VIEW)" />