9 Replies Latest reply on May 11, 2012 9:52 AM by linton chao

    cc.attrs.invalid is evaluated as true even if input field is valid

    Milan Pevec Newbie

      I have a problem using composite inputContainer (JSF2, Glassfish 3.1.1, SEAM3 Faces). In my view, i have:

      <h:form id="f1">    
        <sc:inputContainer  label="Temp1">
          <h:inputText required="true" value="#{customerPresenter.temp1}" />
        <sc:inputContainer  label="Temp2">
          <h:inputText required="true" value="#{customerPresenter.temp2}" />
        <div class="formbuttons">
           <h:commandButton value="temp" action="#{customerPresenter.register()}">

      where my InputContainer code have a following lines:

      <cc:interface componentType="org.jboss.seam.faces.InputContainer">
         <cc:attribute name="label" required="true"/>
         <cc:attribute name="required" required="false"/>
         <cc:attribute name="ajax" required="false" default="false"/>
         <cc:attribute name="inputs" required="false" default="1"/>   
         <div class="formdiv" id="#{cc.clientId}">
              <h:outputLabel id="label" for="" value="#{cc.attrs.label}:" styleClass="#{cc.attrs.invalid ? 'label errors' : 'label'}">
                  <h:panelGroup styleClass="required" rendered="#{cc.attrs.required}">*</h:panelGroup>
               <span class="#{cc.attrs.invalid ? 'input errors' : 'input'}">
               <h:panelGroup rendered="#{cc.attrs.invalid}">
                  <c:forEach var="i" begin="1" end="#{cc.attrs.inputs}">              
                     <h:message id="message#{i}" for="" styleClass="error errors"/>

      First of all I leave my form empty and press button - a validation error appears, as expected, then i populate fields and press button again. An action method is called, but cc.attrs.invalid is still evaluated as true, so my form looks like i have a validation error, but my data is valid. I really need help, iam stucked.. thnx for reply.