You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Neal Haggard <Ne...@sas.com> on 2005/04/14 22:56:42 UTC

Navigation Menu's and being a bit smarter

We're using a panelNavigation object to navigate between sections of a detailed view of an object (in this case, a contact object).  Here's a sample:

<x:panelNavigation itemClass="nav" activeItemClass="navact">
	<x:commandNavigation value="Overview" action="contacts_overview" />
	<x:commandNavigation value="Notes" action="contacts_notes" />
	<x:commandNavigation value="Events" action="contacts_events" />
	<x:commandNavigation value="Activities" action="contacts_activities" />
</x:panelNavigation>

This snippet would get tiled in only on the Contact detail pages.  It works beautifully once I click on one of the navigation commands.

The issue is, when we first drill into a contact, none of the navigation items are active.  Has anyone played around with a way to set commandNavigations as active based on the page they come in to?  Like when I click on a list of contacts, I'd like 'Overview' selected because that's the default page to go to when looking at a contact.  

However, we're going to allow preferences to say what page to go to as a default, which complicates things.  It'd be nice to have something like 'defaultActiveOnViewId="/contacts/overview.jsp"'.

Is there some other way to handle this via a phase listener or something?  Am I looking at this completely wrong?