I reviewed my code lot of times and didnt find questions about it.
I have a problem with p:commandButton rendered property. The p:commandButton is allways displayed even if the getter method returns false. That happens after an ajax update.
I have a p:selectOneMenu with a p:ajax event="change" that sets a MB and updates a p:commandButton (with a rendered property based on a boolean getter) and two other components: a second p:selectOneMenu and a p:outputLabel.
The second p:selectOneMenu and the p:outputLabel are rendered without problems when I change the first p:selectOneMenu selection, but the p:commandButton is allways displayed. The rendered property is not updated.
If I refresh the browser or if I set the update="@form" the p:commandButton is displayed/hidden correctly. But note that all the components are in the same container.
What am I doing wrong? The code:
<p:selectOneMenu id="cmbPais" value="#{pessoaController.selected.endereco.pais}">
<f:selectItems value="#{paisController.itemsSelectOne}"/>
<p:ajax event="change" update="cmbEstado,btnBuscaPeloEndereco,test"/>
</p:selectOneMenu>
<p:outputLabel id="test" value="#{pessoaController.selected.endereco.ok}"/>
<p:commandButton id="btnBuscaPeloEndereco" icon="ui-icon-correios" type="button" onclick="dlgCEP.show();" rendered="#{pessoaController.selected.endereco.ok}"/>
<p:selectOneMenu id="cmbEstado" value="#{pessoaController.selected.endereco.estado}">
<f:selectItems value="#estadoController.getItemsSelectOne(pessoaController.selected.endereco.pais)}"/>
<f:ajax event="change" render="cmbCidade" />
</p:selectOneMenu>