Man! Thank you so much Scott... That's exactly the command i needed... I just didn't know how to get to it from the bean!

This, in combination with nav rules an a simple override to doEdit() to go to edit mode from the portlet decorations (the preferences icon) is doing exactly what i need!

Thank you Scott!

On May 17, 2007, at 6:29 PM, Scott O'Bryan wrote:

Alex, can't you change the portlet mode by getting the native actionResponse? For instance:

ActionResponse action = (ActionResponse)externalContext.getResponse();
action.setPortletMode(PortletMode.EDIT);

This would still resolve to the pages defined in your metadata, but you could have it change the mode. Because it happens early in the lifecycle, you should have an ActionRequest as long as your portlet is the acting portlet.

Scott

Alexander Wallace wrote:
I see... Indeed i can change the next page displayed doing this.. But i have not found how to switch the mode back to view so that the portlet decoration icons go back to the set displayed when in view mode... What I have is the page displayed normally under view mode, but the portlet still is in edit mode...

I've googled a lot and there is not a clear hit telling me how to switch the mode in my faces...

help?

On May 15, 2007, at 12:28 PM, Ryan Wynn wrote:

On 5/11/07, Alexander Wallace <[EMAIL PROTECTED]> wrote:
I can't find much info about the suggestion you make in google... Any
more details are greatly appreciated... Thanks!

what I meant is that command buttons and command links have an
attribute called action which is set to a method binding expression.
This method will be invoked in the jsf process action phase.  Inside
this method it is ok to change the portlet mode.  You do not need to
introduce phase listeners.



On May 10, 2007, at 6:07 PM, Ryan Wynn wrote:

> On 5/10/07, Alexander Wallace <[EMAIL PROTECTED]> wrote:
>> Hi All... I'm finding using portlet modes in jsf at the very least >> cumbersome... Is this really how it is? Should I just forget about
>> portlet modes and use jsf navigation rules to compensate?
>>
>> I'm doing stuff like this: If you hit the edit icon you are taken to >> the edit jsp correctly (so far so good) via override to doEdit and
>> calling nonFacesRequest
>>
>> However, when I want to switch back to view mode, I'm having to
>> override processAction where i can switch the mode, however, i can't >> see any of the parameters and attributes changed in portlet request >> by my bean action listeners... So... i either use a session attribute
>> or do the switch blindly...
>
> You should not have to override processAction in MyFacesGenericPortlet
> to accomplish this.  You can change the portlet mode during the
> process action phase of the jsf lifecycle because this phase happens > within the portlet action phase. You will, however, have to cast the > to portlet specific objects from the external context because jsf does
> not provide a portlet api.
>
>
>>
>> Worse, switching modes doesn't change the VIEW_ID (expected) but i
>> seem to only be able to change that back in doView now (since i
>> changed mode back to view) by checking if i was looking at my "edit" >> view page... Still is too late to validate if i really wanted to go
>> there...
>>
>> Is this really how it is done? Anyone else using portlet modes?
>>
>> Thanks in advance!
>>
>>
>








Reply via email to