At this point i can quickly think of one solution: While you are creating NavigationMenuItems - you are also setting th ID for this component. Set the ID with something on the lines similar to an IP address where the left most is the parent and any children get appended to it using a delimiter.
For all NavigationMenuItem call the same actionListener. Get the Id of the component and parse the ID. This will tell you where to re-direct. I hope it helps. ~madhav On 1/27/07, legolas <[EMAIL PROTECTED]> wrote:
I can not use a data table because in my case companies have childs and i should show them in a hirarchical mode. I am wondering that when we can initialize a panelNavigation2 component with a list of NavigationMenuItem , why we can not find out which menuItem has pressed ? Jeff Bischoff wrote: > > I would use dataTable to accomplish this task. Help can be found here [1]. > > [1] > http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters > > legolas wrote: >> I have a Database table with tens of records the record count is dynamic. >> when use come to my web site i should show him a navigation menu using >> panelNavigation2 . >> >> Navigation items are created by using data that are stored in database, >> so I >> create NavigationMenuItems in backing bean by quering the database. >> >> Each record of the database contains some data related to a Company so >> the >> navigation menu that i create contains label for each company. >> >> Now, When user click on each menuItem i should show that company details >> to >> him. for example use click on menuItem that shows "Yahoo Inc." now I >> should >> show him some information about Yahoo Inc which I have in my database. >> >> What i can not findout, is : >> >> How i should understand that user clicked "Yahoo Inc" menu Item ? >> >> As total number of menu Items are not defined when i create the >> application >> so i can not create an action method for each menu Item. >> >> >> Thanks >> >> >> >> >> >> >> >> >> >> >> >> Madhav Bhargava wrote: >>> I am not sure what are you trying to achieve here. >>> You can associate every Navigation Item with an action method which will >>> be >>> called when the user clicks on the link in the menu >>> >>> On 1/26/07, legolas <[EMAIL PROTECTED]> wrote: >>>> >>>> Hi >>>> Thank you for reading my post. >>>> I have created a dynamic navigation panel using panelNavigation2 and >>>> several NavigationMenuItem. >>>> I have created a list of navigationMenuItem in backend and use it in >>>> GUI. >>>> >>>> now my problm is that, I need to perform some action based on user >>>> input >>>> which is a selected menuItem. >>>> >>>> imagine that i have created a category of products using >>>> panelNavigation2 , >>>> a user come to my web page and view the page and then select one of >>>> NavigationMenuItems, now i should be able to understand which menuItem >>>> has >>>> pressed to show correct information to my users. >>>> >>>> for example if i could do the following procedure, my problem will be >>>> resolved. >>>> >>>> -Assign a number to each NavigationMenuItem (equal to each category >>>> primary >>>> key) and then retrieve that number in the action listener assigned to >>>> NavigationMenuItems. >>>> >>>> any other do-able solution is good for me. >>>> >>>> Thanks. >>>> -- >>>> View this message in context: >>>> http://www.nabble.com/how-i-can-identify-which-menuItem-has-selected-in-backend--tf3118684.html#a8639997 >>>> Sent from the MyFaces - Users mailing list archive at Nabble.com. >>>> >>>> >>> >>> -- >>> When I tell the truth, it is not for the sake of convincing those who do >>> not >>> know it, but for the sake of defending those that do >>> >>> >> > > > > -- View this message in context: http://www.nabble.com/how-i-can-identify-which-menuItem-has-selected-in-backend--tf3118684.html#a8656877 Sent from the MyFaces - Users mailing list archive at Nabble.com.
-- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do

