-
1. Re: tree selection ajax
ilya_shaikovsky Oct 7, 2010 5:42 AM (in response to kandl)it seems that myBean is request scoped so on request from button - #{myBean.selectedNode == null} condition are false again and actionEvent just not risen. make it session scoped or store with keep alive.
-
2. Re: tree selection ajax
kandl Nov 30, 2010 6:36 AM (in response to ilya_shaikovsky)Thanks for reply,
Yes the bean is request scoped. And I have modified the code a little bit to the following
<a4j:outputPanel ajaxRendered="true">
<h:panelGrid id="singleSubfolder" columns="3"
rendered="#{recursiveTreeNodeAdopterBean.selectedNode != null}"><h:outputText id="subfolder1"
value="Create Subfolder in #{recursiveTreeNodeAdopterBean.selectedNode}" />
<h:inputText
value="#{recursiveTreeNodeAdopterBean.singleSubFolderNameToCreate}" />
<a4j:commandButton value="Create"
action="#{recursiveTreeNodeAdopterBean.createSubfolder}">
<f:param name="selectedVal"
value="#{recursiveTreeNodeAdopterBean.selectedNode}" />
<a4j:support event="oncomplete" reRender="treepanel" />
</a4j:commandButton>
</h:panelGrid></a4j:outputPanel>
On the page I have a tree component which represents the file system. Then I have buttons for creating a root folder and a button for creating a subfolder in each root folder. After creating them I reRender the tree.
The problem now is with the create a Single subfolder in the selected folder. As mentioned before with request scope the action method isn't called. But the problem is, that with a4j:keepAlive or with session scope the tree doesn't reRender. Alternatively I have to do a full page reload, but that's not acceptable, because of performance issues.
Is there a possibility that both issues(the reRender from the tree after creating any folder) and to show the panel from the code only if a node is selected and the action is also called.
I'm getting very frustrated about that problem.
Hope that someone can help me.
Kind regards