I want to implement that when a component value changes, another component may get updated, depending on a boolean value in the backing bean. I'm attempting to implement this using the disabled attribute of p:ajax - disable the ajax behavior (don't do the update) if disabled resolves to true. This is the relevant xhtml:
Code: Select all
<h:selectManyMenu >
<p:ajax update="comp_id" disabled="{!bean.hasXproperty()}" />
</h:selectManyMenu>
<h:panelGrid id="comp_id" >
<!-- PF and F components -->
</h:panelGrid>
Code: Select all
public boolean hasXproperty() {
if // some value
return true;
else
return false;
}
Is this the right use of disabled attribute? I'm thinking of changing to using a listener that updates the comp_id component's values, but would like to understand what the issue or misunderstanding might be with the disabled attribute.
Note -- I'm using h:selectManyMenu because of a known issue with p:selectManyMenu in PF 3.0.M1 (where it does not display the selected values when you return to the page)