I'm using primefaces for my front end with java as backing bean. I have a textarea with a clear button attached to it, followed by a selectMenu. When the textarea is not empty, I want my selectMenu disabled, however when the textArea is cleared with the button, I can't seem to get it to update the selectMenu so that it becomes enabled is again. However when the textarea is manually cleared, it updates my selectMenu.
Here is my code:
<p:outputPanel>
<div class="ui-grid-col-3">
<p:inputTextarea id="containerNums" cols="60" rows="3">
<p:ajax event="change" process="@this" immediate="true" update="containerSection">
</p:inputTextarea >
</div>
</p:outputPanel>
<div class="ui-grid-col-3">
<p:commandButton type="button"
value="x"
onclick="clearTextArea(containerNums)"
update="containerType"/>
</div>
<p:outputPanel>
<p:selectOneMenu id="containerType"
value="containerType"
disabled="#{myBean.containerNums != null}">
</p:outputPanel>
Any ideas on what to change to achieve my desired result?