In fact, I also started with a two portlet approach similar to
Michael's (to solve the same problem, browse,view,edit and add of
data) and in the end, I combined them into a single portlet. :)

On 3/13/07, Joachim Müller <[EMAIL PROTECTED]> wrote:
Hi Michael.

Maybe you should think (pragmatically) about combining portlet_A and
portlet_B into one portlet. (I would always combine functionality that
belongs together into one portlet.)

Of course I do not know about your setup, especially if you use
portlet_B somewhere else without portlet_A.


Regards,
Joachim

Michael Binette wrote:
> Aaron,
>
> I agree that your method is good and what I planned on doing initially.
> My problem is that portletB needs its ProcessAction called so that the
> proper portlet mode and window state can be set for the portlet.  I
> can't do that from the doView method.  We use portletB to show a "quick
> view" of the data.  When they edit or add the portlet is maximized so
> that all of the information can be seen and edited.
> --
> Thanks,
> Michael Binette
>
> Aaron Evans wrote:
>> On 3/12/07, Enrique Perez <[EMAIL PROTECTED]> wrote:
>>> 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.
>>
>> I'm not sure, but I don't think that portlet URLs (especially action
>> URLs) are meant to be used in this manner (ie. shared amongst
>> portlets).  If this does indeed work, I would think you would be
>> exploiting something specific to the Jetspeed implementation. If I am
>> wrong, someone please correct me.
>>
>> What I would think you would do instead is this:
>> 1. In portlet A, you display an ACTION url, say called "show add".
>> 2. In processAction for portlet A, you set a portlet session attribute
>> that is PORTLET_APPLICATION in scope, perhaps called "SHOW_ADD" and
>> set it to true.
>> 3. in doView for portlet B, you are always check to see if there is a
>> portlet session attribute called "SHOW_ADD".  If true, then you
>> display the add interface.
>>
>> The action phase for the invoked URL is always processed before the
>> render of any portlets on the page, so your session attribute will be
>> guaranteed to have a value when portlet B checks for it.
>>
>> -aaron
>>
>> ---------------------------------------------------------------------
>> 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