Yes, that's true... I forgot to mention that problem in my former post... =/ Shame on me... I've realized once I've sent it... =/ Unfortunately, as far as I know and according to the specification JSR-168, the order in which portlets are invoked to render is *not* guaranteed (see page 24, lines 21-22). I actually don't know if Jetspeed-2 grants some order or not. But once portletB is rendered, the object should be available for all the portlets... Maybe portletA could force the portal page to render all portlets until it can retrieve the portletB_URL object from the session (if everything works, it should force up to 2 times: if the object is not ready in the first time, because portletA renders before portletB, it should be available the second time).

What do you think?

Regards,
Enrique



Michael Binette escribió:
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to