3 Replies Latest reply on Jun 28, 2007 2:54 PM by Sergey Smirnov

    Validation and requared fields

    mladen babic Newbie

      Hi ,

      I have one selectOneMenu and two inputtext requared fields and these two component are reRendered based on changed value from selectOneMenu (eg. HIDE and SHOW).Problem is when I change value from dropdown component first reqaured field doesn't be hidden and other hidden field doesn't be shown because validation doesn't allowed empty field to be hidden.
      There are code from page:

      <t:selectOneMenu id="property"
       <f:selectItem itemLabel="#{messages.text47}" />
       <f:selectItems value="#{propertyHandler.fieldTypes}" />
       <a4j:support event="onchange" reRender="textRules,propertyName2,propertyName,yesno,panel,eqdrop"></a4j:support>
       <t:outputLabel for="propertyName" value="#{messages.name}"></t:outputLabel>
       <t:inputText columns="40"
       rendered="#{currentProperty.property eq 'SHOW'}"
       id="propertyName" requared="true" value="#{currentProperty.name}" />
      <t:inputText columns="40"
       rendered="#{currentProperty.property eq 'HIDE'}"
       id="propertyName2" requared="true" value="#{currentProperty.name}" />