Navigating to an URL via a MenuModel based MenuBar

UI Components for JSF
Post Reply
zilluss
Posts: 3
Joined: 02 Feb 2012, 22:04

02 Feb 2012, 22:27

This is my first post, so first off: hi folks.

I'm currently working on modularizing an existing project. I use the following hirarchy:

Module Group
-Module

To navigate between the modules, I use a MenuBar. As one may guess: The module groups are Submenus, the modules are MenuItems.
To keep everything dynamic, I build a MenuModel from the module groups and modules. Which modules/groups to include in the MenuBar should be configurable. That's why I want to create it dynamically.

However, I encountered a problem: How can I navigate to the View of the selected module(which is represented by a MenuItem)? I'm currently use a custom MethodExpression that redirects me to the desired URL via

Code: Select all

FacesContext.getCurrentInstance().getExternalContext().redirect(module.getURL());
This seems to be inappropriate. I don't want to redirect manually and furthermore, MethodExpression is deprecated.
I can't use an ActionListener, since I need to pass the URL to the ActionListener which is not possible (Since JSF wants to create its own ActionListener and therefore needs a default constructor).
Is there a proper way to navigate to my module while using a dynamic MenuModel?

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 49 guests