My p:commandButton
stops sending actionListeners
once I add disabled
option. Why is this happening?
I have a p:selectOneListbox
which needs to have something selected before OK
button is enabled:
<p:selectOneListbox value="#{FileSelectBean.fileNameSelected}">
<f:selectItems value="#{FileSelectBean.fileNames}" />
<p:ajax update=":formFileSelect:okId" />
</p:selectOneListbox>
And I have an OK
button:
<p:commandButton id="okId" value="OK"
type="submit" update=":formEncryptionDialog"
actionListener="#{FileSelectBean.actionOk}"
oncomplete="dlgFileSelect.hide();"
disabled="#{FileSelectBean.fileNameSelected.isEmpty()}">
</p:commandButton>
Backing bean:
private String fileNameSelected = "";
All works ok without disabled="#{FileSelectBean.fileNameSelected.isEmpty()}"
. Once I add this, OK button is enabled/disabled properly, but stops calling FileSelectBean.actionOk
after button is clicked.
What went wrong?
Edit:
I have removed <p:ajax update=":formFileSelect:okId" />
and I refresh a button in some other way, but it did not help. So it seams not related to ajax
in selectOneListbox
.