Hi,
I am pretty new to Primefaces or JSF in general and have a question regarding updating elements.
Right now i have a filled tree from a database and what i need is when a treenode is selected within the tree that a outputText elswhere on the page gets updated with the nodeName of the selected node.
Is this possible?
Thanks
Update OutputText element when node in Tree is selected.
Hi,
Yes, this can be achieved with the trees instant ajax selection feature. There is an example here http://primefaces.org:8080/prime-showca ... onAjax.jsf. The example updates a growl, but with a few modifications it could update an outputText.
Yes, this can be achieved with the trees instant ajax selection feature. There is an example here http://primefaces.org:8080/prime-showca ... onAjax.jsf. The example updates a growl, but with a few modifications it could update an outputText.
Thanks, i followed that example. However what i do notice is that when i set update which references to a layoutUnit that the header of the layoutunit doens't get updated. When i set a update on a outputText it works but when i update the layoutUnit it doesnt work or at least i need to referesh my page to see the header of that layout unit with the right value. Is there a way i can make the layoutUnit's header value being updated when i select a node?
PrimeFaces 3.3.4, Primefaces-extensions 0.6.0, JBoss 7.1, Mojarra 2.1.10
I've noticed that in the past myself too. When a layout unit is updated, only the content between <p:layoutUnit> and </p:layoutUnit> gets updated. This means that the header itself is not updated as the header is an attribute of the <p:layoutUnit>.
I assume that this restriction has something to do with interdependencies between layoutUnits. You always use at least two layoutUnits, and updating the attributes of one layoutUnit can effect another layoutUnit. For example, if you have a layout that's 400px high, with a top and center layoutUnit, and you update the height of the top layoutUnit using ajax, what should happen to the center layoutUnits height? To avoid problems here, only the content between <p:layoutUnit> and </p:layoutUnit> gets updated. At least this is what I've always assumed!
An unfortuante side-effect of this is that the header of a layoutUnit can't be updated using ajax.
I assume that this restriction has something to do with interdependencies between layoutUnits. You always use at least two layoutUnits, and updating the attributes of one layoutUnit can effect another layoutUnit. For example, if you have a layout that's 400px high, with a top and center layoutUnit, and you update the height of the top layoutUnit using ajax, what should happen to the center layoutUnits height? To avoid problems here, only the content between <p:layoutUnit> and </p:layoutUnit> gets updated. At least this is what I've always assumed!
An unfortuante side-effect of this is that the header of a layoutUnit can't be updated using ajax.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 33 guests