0

I have a p:selectOneMenu when its selection changes, some controls will be updated below. This works so far, but I added an empty selection placeholder. When this is chosen the validation fails and the content below is no more updated. So I want to do validation only when a button is clicked which submits the form but not when the p:selectOneMenu selection changes. How I can do this?

<p:selectOneMenu id="jobDetailClass" value="#{paramController.selectedJobClass}" styleClass="selectJobClass"
        label="#{msgs['label.jobClass']}" converter="jobClassConverter" validator="#{paramController.validateJobClassSelection}">
        <f:selectItems value="#{paramController.getAvailableJobClasses(paramEditMode)}" var="curJobClass"
            itemLabel="#{curJobClass.name}" itemValue="#{curJobClass}"/>
        <p:ajax event="change" process="@this" update="jobClassElemsGrid" />
</p:selectOneMenu>
opfau
  • 731
  • 9
  • 37
  • Tried immediate="true" on p:ajax but this does not fix it. – opfau Apr 30 '14 at 08:38
  • 2
    Try to apply the logic shown [here](http://stackoverflow.com/a/23133285/870122) – perissf Apr 30 '14 at 08:59
  • Thanks. You saved my day. Only I have to call getValue() instead of getSubmittedValue() and I have to set and remove the style class for validation error by myself to the selectOneMenu. But it works. – opfau Apr 30 '14 at 09:51

0 Answers0