I have a <p:selectOneMenu>
with the required="#{variable == ''}"
attribute.
Furthermore in the same form I have a <h:commandButton>
.
When pressing the button for the first time the selection field is not validated. Instead the field is validated on the second submission and validates that there is no selection.
So it seems that the expression in the required attribute does work, but never on the first submission of the form.
I tried with process="@this fieldId"
but that didn't really help.
Any suggestions ?