Gary,
Thank you for your help. Some things are not totally clear to me though, so
excuse my ignorance in these matters. When you say:
> The shale-dialog does this sort of thing [2]
Do you mean it already does it in some way like:
<dialog name="go_contactus" start="exit">
<end name="exit" viewId="/#{sessionVars.locale}/contactus.jsf"
redirect="true"/>
</dialog>
Which I tried and it doesn't recognize the the EL and just redirects to the
viewed as a string. The description with your link [3] seems to describe
exactly what I need, but when implemented, it doesn't behave any different
from when I don't use these definitions.
So I guess my question is, do I go and extend
org/apache/myfaces/application/NavigationHandlerImpl.java and build a way to
recognize the EL in my viewId (how would be the next question) or is it a
matter of configuring my faces-config.xml to use the correct handlers that
can already do this?
Thank you for your patience with my coming to grips with the issues at hand,
Joost
-----Original Message-----
From: Gary VanMatre [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 12, 2007 2:30 AM
To: [email protected]
Subject: Re: Alternate ViewController
>From: "JS Portal Support" <[EMAIL PROTECTED]>
>
> Hi,
>
> Though this primarily is a jsf question, I place it here since it might
> involve the Clay viewhandler.
>
> I wish to implement a viewhandler that can understand the following
> navigation rule, and followed the steps as described in [1]
>
><navigation-rule>
>
> <from-view-id>*</from-view-id>
> <navigation-case>
>
<from-outcome>go_contactus</from-outcome>
>
<to-view-id>/#{sessionVars.locale}/contactus.jsf</to-view-id>
> <redirect/>
> </navigation-case>
> </navigation-rule
>
>
> I extended the org.apache.shale.clay.faces.ClayViewHandler and just added
> the getActionURL(FacesContext context, String viewId). Unfortunately it is
> not working. The page just reloads itself and that's all.
>
> Is there already a system in place that does this as it seems to me a
> usefull feature. If not, what am I doing wrong, and should I be extending
> the ClayViewHandler or the MyFaces ViewHandler?
>
You are not using the best extension point. The navigation handler is the
place I'd try adding this extension [1]. The shale-dialog does this sort of
thing [2]. Like the other JSF extension points, you will want to decorate
the original that will be passed via the custom navigation handler's
constructor. The custom navigation handler gets registered in the faces
config [3].
Gary
[1]
http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apach
e/myfaces/application/NavigationHandlerImpl.java?view=markup
[2]
http://svn.apache.org/viewvc/shale/framework/trunk/shale-dialog/src/main/jav
a/org/apache/shale/dialog/faces/DialogNavigationHandler.java?view=markup
[3]
http://svn.apache.org/viewvc/shale/framework/trunk/shale-dialog/src/main/res
ources/META-INF/faces-config.xml?view=markup
> Thank you,
> Joost Schouten
> Dasstraat 21
> 2623CB Delft
> the Netherlands
>
> [1]
>
http://typo.ars-subtilior.com/articles/2007/01/24/how-to-make-jsf-navigation
> -rules-more-dynamic
>
>