Dienstag, Juli 17, 2007

 

Dynamic JSCookMenue to the same outcome

The problem occurs on a JSCookMenue, if you wish to create the NavigationItems dynamically from a backing bean and some of the menu entries should be result in the same outcome. Typically you want to distinct the selected menu entries on the selected page (target of the outcome), but this is impossible, because you can't transfer the information of the selected entry.

In case of static NavigationItems you can use an ActionListener to transfer this information into a backing bean, where you can read this information on the next page. But in case of dynamically created menuitems you havn't the possiblility to add an ActionListener , because the NavigationItem isn't a Component. Only the JSCookMenu is.

So that is the problem. The solution I found is dirty, but it works. Better approaches are welcome !

The only thing you can add to a NavigationItem is the action attribute. So I extend the action attribute from "report" to something like "report_report1" and "report_report2". Then I wrote a custom NavigationHandler that hijacks outcomes which starts with "report_" and the only Job of this NavigationHandler is to change the outcome to "report" and put the other part of the term ("report1" or "report2") into a sessionbased backingbean.

This approach is weak, because it adds a new meaning to the naming of action outcomes, but currently I doesn't found anything else working for me.

Labels: , ,


Comments:
Das muss ich mal loswerden...

for /L %N IN (1, 1, 254) DO ping -n 1 -w 1000 192.168.178.%N
 
Kommentar veröffentlichen



<< Home

This page is powered by Blogger. Isn't yours?