• Post Reply Bookmark Topic Watch Topic
  • New Topic

how do menus fit in with the faces-config.xml

 
steve Barf
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know much about JSF yet - being 'urged' to use it by customer. But if one of the benefits is that the 'controller' part of mvc is exposed in the faces-config.xml file - how would one handle navigation from a menu eg. a jscookmenu where you can navigate to say 25 different destinations ? Surely you wouldn't have 25 navigation-rules for each screen ?

 
steve Barf
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or 25 <navigation-case>s ...
 
Tim Holloway
Bartender
Posts: 18408
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Navigation is an outbound process, not an inbound process. You can specify an action specific to a return value for a given backing bean, but you can also specify an action value that applies globally.

A classic example of this is to set up a navigation rule that says when any backing bean returns "login", the target will be the login page. The same can be done with menus.

You also can tie to a specific backing bean action to get context-sensitive menu items.

There's also a way using jsCook to define targets in the menu itself without the need to define anything new in faces-config. It's a hard-coded "goto" action. But I'm having trouble getting that to work at the moment. I understood it a while back, then forgot about it. Someday somebody will document the stupid thing better.
 
Tim Holloway
Bartender
Posts: 18408
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just in case I muddied the water there, when I said you can have global rules, I meant specifically a case where there's 25 global rules that all pages can be targeted from instead of 25 rules per source page.
 
Md Fizal
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, actionListener method can be attached to the NavigationMenuItems in JSCookMenu. For example,



When a menu item is selected, method 'menuSelect()' in 'NumberBean' will be called. Does anybody know how to get which menu item was selected?
 
Bert Bates
author
Sheriff
Posts: 8919
11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Steve,

Is that your real last name? If not, please update your display name to match our naming policy.

Thanks!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!