[ http://issues.apache.org/jira/browse/MYFACES-87?page=comments#action_62319 ] Galen Dunkleberger commented on MYFACES-87: -------------------------------------------
Kito, <trivial-background> I had toyed with modifying NavigationMenuItem and including string parameters of action and actionListener and also a collection of strings for actionlisteners. Also I added an id attribute to my modified NavigationMenuItem so that I could retrieve it later. Then (taking a hint from your book) I create an extension of arraylist to hold all the NavigationMenuItems. HtmlJSCookMenu was then modified to contain an instance of NavigationMenuItemList. UINavigationMenuItem was made to implement ActionSource...likewise it's tag class was modified to accommodate the new attributes The JsCookMenuRenderer then wrote the id of each NavigationMenuItem to the view. You could then attach an action, actionListener method, and multiple actionListener classes to each individual item. When an item was selected the id would be passed back in the jscook_action parameter, this parameter value could be used to look up the NavigationMenuItem from the NavigationMenuItemList...the action, actionListener method binding, and the actionlistener classes (all held as strings in the NavigationMenuItem could be used to create new method and value binding which could then be set in the JsCookMenu and fired off. It seemed to work for me. </trivial-background> Ok so why did I write all that? I was able to get it to work but I wondered at what cost to the whole MVC pattern? It is wrong to put things like action, actionListener and actionListeners (as string representations) in the model for use in the view? I decided not to use my modified jscookmenu b/c I found a way I could accomplish what I needed to do without it. Still like I said before, I feel like anything that user can click on should be an action source. Isn't it that way in swing? Thanks for the comment. > x:updateActionListener inside x:navigationMenuItem > -------------------------------------------------- > > Key: MYFACES-87 > URL: http://issues.apache.org/jira/browse/MYFACES-87 > Project: MyFaces > Type: New Feature > Versions: 1.0.8 beta > Environment: Tomcat5 > Reporter: Alessandro Polverini > Priority: Minor > Attachments: classes_patch.txt, tld_patch.txt > > Hello, > it would be nice if x:navigationMenuItem would be an ActionSource so that a > x:updateActionListener could be nested inside one of its elements. > Thanks, > Alex -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira
