jsf - How to add ui-icon to my header panel dynamically? -


i create panel dynamically , want add icon 'ui-icon-pencil' header panel dynamically too. saw possible f:facet tag, don't know how dynamically add tag. suggestion maybe?

i want xhtml structure java code:

<p:panel id="pnl">       <f:facet name="options">           <h:outputtext value="panel 1"/>         <p:menuitem value="edit" url="#" icon="ui-icon-pencil"/>     </f:facet> </p:panel> 

and need click listener on menuitem.

you can add facets component programmatically putting them in map available uicomponent#getfacets().

so, java equivalent of this:

<p:panel>     <f:facet name="header"><h:outputtext value="bar" /></f:facet> </p:panel> 

would follows:

panel panel = new panel(); uioutput header = new htmloutputtext(); header.setvalue("bar"); panel.getfacets().put("header", header); 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -