You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Alexander Wallace <aw...@rwmotloc.com> on 2007/05/11 00:57:15 UTC

using portlet modes

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...

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!


Re: using portlet modes

Posted by Alexander Wallace <aw...@rwmotloc.com>.
Thank you very much for your reply... I will do some research on the  
jsf phases ... Any pointers is greatly appreciated also...

Thanks!

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

> On 5/10/07, Alexander Wallace <aw...@rwmotloc.com> 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!
>>
>>
>


Re: Struts JSTL Migration

Posted by "::SammyRulez::" <sa...@gmail.com>.
I have solved the same problem moths ago.

I supose you have dom and xslt/dom in the xml and xslt vars.

I developed a managedbean based on dom4j.

Move the code you youe to ooad xml and xslt to that bean and make a
getTransformedData() method like this

public String getTransformedData() {
  // load the transformer using JAXP
        TransformerFactory factory = TransformerFactory.newInstance();
        Transformer transformer = factory.newTransformer(
            new StreamSource( stylesheet )
        );

        // now lets style the given document
        DocumentSource source = new DocumentSource( document );
        DocumentResult result = new DocumentResult();
        transformer.transform( source, result );

        // return the transformed document
        Document transformedDoc = result.getDocument();
        return transformedDoc.asXML();
}


where document and stylesheet are your old xml and xslt.


then replace your tag with a simple

<h:outputText value="#{transformerBean.tansformedData}" ecape="false" />



2007/5/15, Kevin Gutch <kg...@protechemail.com>:
> Hi,
>
> I have an existing application that I am completely migrating to JSF.
> Everything seems fine but I am trying to figure out what to do with an
> area of the app where I use
> <x:transform xml="${xml}" xslt="${xslt}" />. This does not want to seem
> to work with JSF. Should it? If not what are my alternatives?
>
> Thanks
>
> Kevin
>
>


-- 
::SammyRulez::
http://www.kyub.com/blog/
-----------------------------------------------------------------
La programmazione รจ per un terzo interpretazione e per due terzi ispirazione.
 E per un terzo mistificazione

Struts JSTL Migration

Posted by Kevin Gutch <kg...@protechemail.com>.
Hi,

I have an existing application that I am completely migrating to JSF. 
Everything seems fine but I am trying to figure out what to do with an 
area of the app where I use
<x:transform xml="${xml}" xslt="${xslt}" />. This does not want to seem 
to work with JSF. Should it? If not what are my alternatives?

Thanks

Kevin

Re: using portlet modes

Posted by Alexander Wallace <aw...@rwmotloc.com>.
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 <aw...@rwmotloc.com> 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 <aw...@rwmotloc.com> 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!
>>>> >>
>>>> >>
>>>> >
>>>>
>>>>
>>>
>>
>>
>
>


Re: using portlet modes

Posted by Scott O'Bryan <da...@gmail.com>.
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 <aw...@rwmotloc.com> 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 <aw...@rwmotloc.com> 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!
>>> >>
>>> >>
>>> >
>>>
>>>
>>
>
>


Re: using portlet modes

Posted by Alexander Wallace <aw...@rwmotloc.com>.
It definitely does! Thank you very much! it works great!

On May 18, 2007, at 9:08 AM, Cooper, Stephen wrote:

> Here's how I do it for Edit Mode going back to View mode after the  
> user
> presses "Save".
>
> I have a public String save() method which tells the preferences to  
> save
> themselves, then it calls this static method (I made it static so that
> any JSF bean can call it as part of its action method):
>
>     /**
>      * Change the mode for this portlet to VIEW.  This method is  
> static
> so
>      * that it may be accessed from any bean.
>      */
>     public static void switchToView() {
>         if (null == FacesContext.getCurrentInstance()) return;
>         ExternalContext externalContext =
>             FacesContext.getCurrentInstance().getExternalContext();
>         if (externalContext.getResponse() instanceof ActionResponse)
>         {
>             ActionResponse response =
>                 (ActionResponse) externalContext.getResponse();
>             try
>             {
>                 response.setPortletMode(PortletMode.VIEW);
>             }
>             catch (PortletModeException e)
>             {
>                 logException(e);
>             }
>         }
>     }
>
> Hope this helps.
>
>
>
> -----Original Message-----
> From: Alexander Wallace [mailto:aw@rwmotloc.com]
> Sent: Thursday, May 17, 2007 3:17 PM
> To: MyFaces Discussion
> Subject: Re: using portlet modes
>
> 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 <aw...@rwmotloc.com> 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 <aw...@rwmotloc.com> 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!
>>>>>
>>>>>
>>>>
>>>
>>>
>>
>
>


RE: using portlet modes

Posted by "Cooper, Stephen" <St...@McKesson.com>.
Here's how I do it for Edit Mode going back to View mode after the user
presses "Save".

I have a public String save() method which tells the preferences to save
themselves, then it calls this static method (I made it static so that
any JSF bean can call it as part of its action method):

    /**
     * Change the mode for this portlet to VIEW.  This method is static
so
     * that it may be accessed from any bean.
     */
    public static void switchToView() {
        if (null == FacesContext.getCurrentInstance()) return;
        ExternalContext externalContext = 
            FacesContext.getCurrentInstance().getExternalContext();
        if (externalContext.getResponse() instanceof ActionResponse)
        {
            ActionResponse response = 
                (ActionResponse) externalContext.getResponse();
            try
            {
                response.setPortletMode(PortletMode.VIEW);
            }
            catch (PortletModeException e)
            {
                logException(e);
            }
        }
    }

Hope this helps.



-----Original Message-----
From: Alexander Wallace [mailto:aw@rwmotloc.com] 
Sent: Thursday, May 17, 2007 3:17 PM
To: MyFaces Discussion
Subject: Re: using portlet modes

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 <aw...@rwmotloc.com> 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 <aw...@rwmotloc.com> 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!
>> >>
>> >>
>> >
>>
>>
>


Re: using portlet modes

Posted by Alexander Wallace <aw...@rwmotloc.com>.
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 <aw...@rwmotloc.com> 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 <aw...@rwmotloc.com> 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!
>> >>
>> >>
>> >
>>
>>
>


Re: using portlet modes

Posted by Ryan Wynn <bi...@gmail.com>.
On 5/11/07, Alexander Wallace <aw...@rwmotloc.com> 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 <aw...@rwmotloc.com> 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!
> >>
> >>
> >
>
>

Re: using portlet modes

Posted by Alexander Wallace <aw...@rwmotloc.com>.
I can't find much info about the suggestion you make in google... Any  
more details are greatly appreciated... Thanks!

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

> On 5/10/07, Alexander Wallace <aw...@rwmotloc.com> 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!
>>
>>
>


Re: using portlet modes

Posted by Alexander Wallace <aw...@rwmotloc.com>.
To make sure I'm in the right track... WIll this involve using  
PhaseListeners? If so.. I didn't find a Phace Id with that suggested  
it was the "process action phase" ...

I promisse to learn these phases stuff in depth, but any help for the  
immediate need is greatly appreciated.

thanks!

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

> On 5/10/07, Alexander Wallace <aw...@rwmotloc.com> 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!
>>
>>
>


Re: using portlet modes

Posted by Ryan Wynn <bi...@gmail.com>.
On 5/10/07, Alexander Wallace <aw...@rwmotloc.com> 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!
>
>