title: How to add ui-icon to my header panel dynamically?
body: <p>I create my panel dynamically and i want to add icon like 'ui-icon-pencil' to my header panel dynamically too. I saw that it was possible to do with f:facet tag, but I don't know how to dynamically add this tag. A suggestion maybe?</p>
  
  <p>I want this XHTML structure with java code:</p>
  
  <pre><code>&lt;p:panel id="pnl"&gt;  
      &lt;f:facet name="options"&gt;  
          &lt;h:outputText value="Panel 1"/&gt;
          &lt;p:menuitem value="Edit" url="#" icon="ui-icon-pencil"/&gt;
      &lt;/f:facet&gt;
  &lt;/p:panel&gt;
  </code></pre>
  
  <p>And I need a click listener on my MenuItem.</p>