How I can build <rich:dropDownMenu> dynamically with icon?
rart3001_1 Aug 9, 2011 10:11 PMGreetings.
I have a question, how to add images (icons) dynamically to a menu?
I want to dynamically create the following code:
<h:form id="form-menu">
<rich:toolBar>
<rich:dropDownMenu>
<f:facet name="label">
<h:panelGroup>
<h:graphicImage value="/images/thumb_100wide.gif" style="width : 15px; height : 15px;" />
<h:outputText value="File" />
</h:panelGroup>
</f:facet>
<rich:menuItem submitMode="ajax" value="New" action="#{ddmenu.doNew}" icon="/images/thumb_100wide.gif" style="width : 15px; height : 15px;">
<f:facet name="icon">
<h:graphicImage value="/images/thumb_100wide.gif" style="width : 15px; height : 15px;" />
</f:facet>
</rich:menuItem>
<rich:menuItem submitMode="ajax" value="Open" action="#{ddmenu.doOpen}" >
<f:facet name="icon">
<h:graphicImage value="/images/thumb_100wide.gif" style="width : 15px; height : 15px;" />
</f:facet>
</rich:menuItem>
<rich:menuSeparator id="menuSeparator2" />
<rich:menuItem submitMode="ajax" value="Close" action="#{ddmenu.doClose}" />
<rich:menuSeparator id="menuSeparator1" />
<rich:menuItem submitMode="ajax" value="Exit" action="#{ddmenu.doExit}" />
</rich:dropDownMenu>
</rich:toolBar>
</h:form>
Which I have to do so exactly, that my .css to work properly. (I attach the image with the result code)
Exactly the problem I have is, I do not know how to dynamically add <f:facet name="label"> and <f:facet name="icon"> to my components HtmlDropDownMenu and HtmlMenuItem.
Thanks for your help and excuse my English
-
Pantallazo.png 21.9 KB