setPropertyActionListener works once

UI Components for JSF
Post Reply
sbonnema
Posts: 2
Joined: 21 Feb 2018, 22:48

22 Feb 2018, 08:46

Hello,

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));
	}
...
}
Using Primefaces 6.1.

Any idea about the root cause ?
Last edited by sbonnema on 22 Feb 2018, 10:17, edited 1 time in total.

Jan Eckert
Posts: 84
Joined: 11 Sep 2014, 10:13
Location: Brussels, Belgium

22 Feb 2018, 09:40

Cannot reproduce, full example please with library versions.
Primefaces 6.1+
Wildfly 11

sbonnema
Posts: 2
Joined: 21 Feb 2018, 22:48

23 Feb 2018, 08:52

After opening a section, the listener works once again.

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

23 Feb 2018, 10:37

Jan Eckert wrote:
22 Feb 2018, 09:40
Cannot reproduce, full example please with library versions.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 22 guests