I have the following method in bean:
public void methodBean(String key){
MyObject object = new MyObject();
System.out.println("parent key: " + key);
if (key != null && !key.equals("")) {
object = MyClient.getInfo(key);
myMapChild = MyDomain.dataToModel(object);
}else{
myMapChild = new HashMap<String, String>();
}
}
which at the click of the parent p:commandbutton: (xhtml)
<p:tab id="step2" title="TEST STEP 2">
<p:panel id="panelCategory">
<h:panelGrid id="testStep2" columns="1">
<h:panelGrid columns="1" columnClasses="label" >
<p:panelGrid>
<f:facet name="header">
<p:row>
<p:column colspan="6">Title</p:column>
</p:row>
</f:facet>
<p:row>
<c:forEach items="#{myBean.myMapParent}" var="entry">
<p:commandButton value="#{entry.value}" action="#{myBean.methodBean(entry.key)}" update="catalogChildList"
/>
</c:forEach>
</p:row>
</p:panelGrid>
<p:panelGrid id="catalogChildList">
<p:row>
<c:forEach items="#{myBean.myMapChild}" var="entry" >
<p:column>
<p:commandButton value="#{entry.value}"/>
</c:forEach>
</p:row>
</p:panelGrid>
</h:panelGrid>
</h:panelGrid>
</p:panel>
must update the list and show me the corresponding buttons, the problem is that the first click does not update the child buttons but the second click updates the content.
Thank you all for the answers