If I add a p:commandButton with the same setPropertyActionListeners it works as expected. I've put breakpoints in the getter for #{flaggedSuppliers.selectedSupplier} and it's not called on the node selection, but it is called twice, as expected, when the command button is clicked.
Here's the key part of the facelet. Note that the onNodeSelected sets the appropriate value of selectedSupplier in the backing bean.
Code: Select all
</p:treeNode>
<p:ajax event="select" listener="#{flaggedSuppliers.onNodeSelected}" update="supEditPanel,:invForm:supInvoicesPanel">
<f:setPropertyActionListener target="#{supEdit.supplier}" value="#{flaggedSuppliers.selectedSupplier}"/>
<f:setPropertyActionListener target="#{invoiceTree.supplier}" value="#{flaggedSuppliers.selectedSupplier}"/>
</p:ajax>
</p:tree>
<p:commandButton value="Refresh" action="#{flaggedSuppliers.refresh}"
update="flaggedTree" ajax="true"/>
<p:commandButton value="Details" ajax="true" update="supEditPanel,:invForm:supInvoicesPanel">
<f:setPropertyActionListener target="#{supEdit.supplier}" value="#{flaggedSuppliers.selectedSupplier}"/>
<f:setPropertyActionListener target="#{invoiceTree.supplier}" value="#{flaggedSuppliers.selectedSupplier}"/>
</p:commandButton>