This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes JSF and the fly likes JSF with Facelets - Using Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSF
Bookmark "JSF with Facelets - Using "h:commandLink" inside header of the layout" Watch "JSF with Facelets - Using "h:commandLink" inside header of the layout" New topic
Author

JSF with Facelets - Using "h:commandLink" inside header of the layout

Daniel Reznick
Ranch Hand

Joined: Oct 23, 2008
Posts: 50

Hi!

I recently added facelets ability to my web app based on JSF

I have added a header.xhtml so it will be displayed on top of each page...

now i want to add a link inside the header, link which will take the user to the "Home" of the webapp, something like this:


and i added to faces-config.xml the following mapping :


but it does not work... the only way i managed to make it work is to add a mapping into faces-config.xml which will point from each page for example TestMenu.xhtml in my web app to the /MainMenu.xhtml using this <from-outcome>Home</from-outcome>
like this:


But... I don't want to use this solution cause it'll force me to add allot of mapping into the faces-config.xml file...

How can i solve this problem with minimum edit inside the faces-config.xml file?

Thanks ahead...

Daniel.

[ October 23, 2008: Message edited by: Daniel Reznick ]
[ October 23, 2008: Message edited by: Daniel Reznick ]
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16103
    
  21

Just remove the value from the from-view-id element. The from-view-id qualifies what view the mapping applies to. If you omit it, the default is that it applies to all views.

The name of the view is based on the entire page, not specific sections within it, which is where your original problem came from.


Customer surveys are for companies who didn't pay proper attention to begin with.
Daniel Reznick
Ranch Hand

Joined: Oct 23, 2008
Posts: 50

Thanks!

worked like charm
[ October 26, 2008: Message edited by: Daniel Reznick ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSF with Facelets - Using "h:commandLink" inside header of the layout