In my project I'm adding programmatically a composite component to a primefaces p:panel, as described here: How to programmatically or dynamically create a composite component in JSF 2 .
This is the composite component:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:p="http://primefaces.org/ui">
<composite:interface>
</composite:interface>
<composite:implementation>
<h:panelGroup styleClass="ui-grid ui-grid-responsive"
id="myPG" layout="block">
<div class="ui-grid ui-grid-responsive label-777777">
<div class="ui-grid-row">
<div class="ui-grid-col-11-5">
<label>#{msgs['label.content']}</label>
</div>
</div>
</div>
<p:commandButton styleClass="myButton blueButton"
id="myCompositeButton" value="#{msgs['button.elimina']}"
update="@form"
actionListener="#{myController.onMyClick}" />
</h:panelGroup>
</composite:implementation>
</html>
When added to the page, it show fine, but after the postback of the button, the "div" part, disappear (it isn't sent to the browser).
If I implements the div whith h:panelGroup and h:outputlabel, the elements get rendered but empty (#{msgs['label.content']} is void).
Here is the onMyClick handler (no logic in it):
public void onMyClick()
{
System.out.println("#########################################CALLBAK");
}
Where I'm wrong?
Primefaces version is 5.1, running on JBoss AS 7.1.1