This content has been marked as final.
Show 4 replies
-
1. Re: ReRendering menuItem
ilya_shaikovsky Apr 16, 2008 11:52 AM (in response to hhuber)look this simpel test works for me:
<h:form id="menu"> <rich:toolBar> <rich:dropDownMenu binding="#{menucomponent.downMenu}"/> </rich:toolBar> </h:form>
private HtmlDropDownMenu downMenu;private HtmlDropDownMenu downMenu; public String createMenu() { downMenu = new HtmlDropDownMenu(); downMenu.setValue("label"); downMenu.setSubmitMode("ajax"); downMenu.setId("menu"); HtmlMenuItem menuItem = new HtmlMenuItem(); menuItem.setValue("first item"); menuItem.setReRender("menu"); FacesContext facesContext = FacesContext.getCurrentInstance(); menuItem.setActionExpression(facesContext.getApplication() .getExpressionFactory().createMethodExpression( facesContext.getELContext(), "#{menucomponent.addItem}", String.class, new Class[0])); downMenu.getChildren().add(menuItem); return "/menu.xhtml"; } public HtmlDropDownMenu getDownMenu() { return downMenu; } public void setDownMenu(HtmlDropDownMenu downMenu) { this.downMenu = downMenu; } public String addItem() { HtmlMenuItem menuItem = new HtmlMenuItem(); menuItem.setValue("new item"); menuItem.setReRender("menu"); downMenu.getChildren().add(menuItem); return null; }
every time I click first item - new Item appears inside. -
2. Re: ReRendering menuItem
ilya_shaikovsky Apr 16, 2008 12:01 PM (in response to hhuber)create menu called from the previous page action
-
3. Re: ReRendering menuItem
hhuber Apr 25, 2008 6:36 AM (in response to hhuber)thank you for your reply. it brought me onto the right track. rerendering now works fine.
cheers,
oliver -
4. Re: ReRendering menuItem
sam_pc1611 Apr 9, 2010 4:28 PM (in response to hhuber)excellenttttttt!!!!!!!