I have two pages in my application where setPropertyActionListener does not wok as expected. The listener works once only. The page must be refresh to works a new once.
The XHTML page content seems the same as other pages that work fine.
Following XHTML and Java code :
Code: Select all
<p:treeTable id="tree" value="#{model.rootNode}" var="item" resizableColumns="true" liveResize="true"
rendered="#{not empty model.rootNode}">
<f:facet name="header">
<p:commandButton icon="fa fa-minus-square"
actionListener="#{controller.collapseAll}" update="tree" />
<p:commandButton icon="fa fa-plus-square"
actionListener="#{controller.expandAll}" update="tree" />
</f:facet>
<p:column headerText="Produit" style="width:220px">
<h:outputText value="#{item.name}" title="#{item.poleName}" />
</p:column>
<p:column headerText="Projet" style="width:100%">
<h:outputText rendered="#{item.key > 0 and not status.admin}"
value="#{''.concat(item.desc).concat(' [').concat(item.name).concat('] : ').concat(item.version)}" />
<p:commandLink update=":form:itemPanel" rendered="#{item.key > 0 and status.admin}"
oncomplete="PF('itemDialog').show()">
<h:outputText
value="#{''.concat(item.desc).concat(' [').concat(item.name).concat('] : ').concat(item.version)}" />
<f:setPropertyActionListener value="#{item.key}" target="#{controller.selectedKey}" />
</p:commandLink>
</p:column>
</p:treeTable>
Code: Select all
@ManagedBean(name = "controller")
@ViewScoped
public class MyController {
...
public void setSelectedKey(Long key) {
model.setSelectedItem(rs.getItem(key));
}
...
}
Any idea about the root cause ?