I've been trying to use a p:commandButton in a ui:repeat, h:dataTable and a p:datatable.
Each row has its own button that is supposed assign(with Ajax) a backing bean value to an object referenced in p:dialog. In none of my attempts has the AJAX call updated the appropriate component after the call to the bean.
Code: Select all
<p:dataTable var="item" value="#{backingBean.objectList}" >
<p:column>
<f:facet name="header">
<h:outputText value="Type"/>
</f:facet>
<h:outputText value="#{object.typeValue}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="Edit"/>
</f:facet>
<p:commandButton
oncomplete="editDialog.show();"
update="editDialogComponent"
actionListener="#{backingBean.editObject}" //sets the backingBean.editableObject to point to the current row object
value="Edit" />
</p:column>
</p:dataTable>
<p:dialog
id="editDialogComponent"
widgetVar="editDialog"
header="Edit object"
modal="true">
<h:panelGrid columns="2" cellspacing="1" cellpadding="1">
<h:outputText value="Type" />
<h:outputText value="#{backingBean.editableObject.typeValue}" />
</h:panelGrid>
<p:commandButton
styleClass="btn"
onmouseover="this.className='btn btnhov'"
onmouseout="this.className='btn'"
actionListener="backingBean.saveObject"
value="Save" onclick="editDialog.hide();" />
</p:dialog>
Are you aware of this?
Thanks,
Jacques