Enrique,
That sounds promising and I will check into that. My only concern would
be the order the portlets get rendered. If portletA gets rendered
before portletB then the ActionURL would not exist in the session yet.
--
Thanks,
Michael Binette
Enrique Perez wrote:
Hi Michael,
I don't know if I get your problem properly...
Supposed two portlets (portletA and portletB)...
what you want to achieve is to call portletB's processAction from
portletA, right?
I think you can create an action URL in *portletB* (with the method
"createActionURL" in the "RenderResponse" object). Set the parameters
you want for this portlet when it'd be invoked (portlet mode and
window state):
PortletURL portletB_URL = response.createActionURL();
portletB_URL.setPortletMode(PortletMode.EDIT);
portletB_URL.setWindowState(WindowState.NORMAL);
...
and then propagate the actionURL object created to all the portlets in
the application as an attribute session (with APPLICATION_SCOPE):
request.getPortletSession().setAttribute("portletB_URL",
portletB_URL, PortletSession.APPLICATION_SCOPE);
Once you have done this, you can retrieve the portletB_URL object from
*portletA*:
PortletURL portletB_URL = (PortletURL)
request.getPortletSession().getAttribute("portletB_URL",
PortletSession.APPLICATION_SCOPE);
so you can use it as target for a link or a form:
<FORM ACTION=\""+portletB_URL.toString()+"\" METHOD=\"post\">
I've never checked this code but I think it might work... =D
Hope that helps.
Regards,
Enrique
Michael Binette escribió:
I have two portlets. One shows a list of items, lets say Widgets,
and when you click on a Widget in the list it shows the details of
that Widget in the second portlet.
The second portlet has an Edit button that allows you to edit the
Widget being displayed.
What I have now is an Add Widget button on the second portlet but to
me, that is not where it belongs. It belongs in the first portlet
that shows the list of Widgets.
I want an "Add Widget" button in the first portlet that when clicked,
causes the second portlet to go into edit mode to edit the new Widget.
I can't figure out how to get that done. I thought I could redirect
or forward from the doEdit() method of the second portlet to an
actionURL for the second portlet if there was a certain value in the
PortletSession but I don't see a way of
redirecting/forwarding/causing an Action request to be sent to the
second portlet.
--
Thanks,
Michael Binette
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]