• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 50
jQuery Eclipse IDE Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Daniel Reznick
Ranch Hand
Posts: 50
jQuery Eclipse IDE Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks!

worked like charm
[ October 26, 2008: Message edited by: Daniel Reznick ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic