My xhtml code is:
<p:tree id="attachTree" style="width: 100%;" value="#{detailsTaskBacking.attachRootNode}" selectionMode="single" selection="#{detailsTaskBacking.selectedNode}" var="node">
<p:ajax event="select" async="false" update=":roteiroAttachTab:formAttachForm:mediaPdf" listener="#{detailsTaskBacking.onNodeSelect}"/>
<p:treeNode expandedIcon="ui-icon-folder-open" collapsedIcon="ui-icon-folder-collapsed">
<h:outputText value="#{text['tasksbacking.tabAttach']}"/>
</p:treeNode>
<p:treeNode type="file" expandedIcon="ui-icon-document" collapsedIcon="ui-icon-document">
<h:outputText value="#{node.name}"/>
</p:treeNode>
</p:tree>
And my bean code is:
@request
...
public void onNodeSelect(NodeSelectEvent event) {...}
When run the project in debug mode selectedNode for argument event is null, why?
Why in primefaces tree ajax events not work when bean scope is request? I tested this with one bean in view scope and the selectedNode is not null, why?