I have a primefaces menu which items are disabled on a condition from backing bean. The problem is, that the conditions are processed after the update.
If I select a node which has every item enabled and switch to a node where everything is disabled, the menu is reloaded but shows everything enabled for a second before the items are disabled.
Is there a way to process the disabled-conditions before the menu is shown?
<h:form id="form">
<p:tree id="tree" ...>
<p:ajax event="select" update=":form:tree:menu" listener...>
<p:treeNode id="treenode">
<p:commandButton id="btn" type="button" />
<p:overlayPanel for="btn">
<p:menu id=menu">
<p:menuitem .... disabled="#{bean.condition1}" />
<p:menuitem .... disabled="#{bean.condition2}" />
...
</p:menu>
</p:overlayPanel>
</p:treenode>
</p:tree>
type="button"
makes it a dead client side button, not a submit button which interacts with server with ajax magic and all. Perhaps you wasn't aware of that? – BalusC