4 Replies Latest reply on Dec 17, 2009 6:17 PM by nimo22

    rich:message facet passedMarker

    nimo22


      Hello,

       

      I have a question about the rich:message facet passed Marker.

       

      The documentation says (rich:message-tag p.606):

       

      "The attribute "passedLabel" is used for definition of the label to display when no message appears. But the
      message component doesn't appear before the form submission even when state is defined
      as passed (on initial rendering)."

       

      Look at the demo http://livedemo.exadel.com/richfaces-demo/richfaces/message.jsf;jsessionid=52283C97064880E45967038523199E99?c=message&tab=usage - the demo shows that in all fields passed markers are shown even I have not put values in all (required) fields.

       

      So why is a field passed when no validation for this field is occured?

       

      I have assumed, that a passedMarker is only shown, when validation of one field does not fail - but this is not the case: the passedMarker is even shown when fields are required and empty.

       

      The passedMarker should only passed a field after validation and not before:

       

      for example, look at https://twitter.com/signup : the passedMarker is only shown, if the actual field is validated correctly - and all other fields does not get a passedMarker, because the validation of the other field is not happen - this is a correct behaviour. I only should have a passedMarker when the field is validated correctly and other fields should not been affected when the validation of these other fields lays in the future.

        • 1. Re: rich:message facet passedMarker
          ilya_shaikovsky
          • 2. Re: rich:message facet passedMarker
            nimo22

            oh that was it, but for rich:messages.. hmm.. I am using rf 3.3.2. for rich:message passedLabel and passedMarker still exists:

             

            {code}<h:form>

             

            <h:outputLabel value="e-mail"/>


            <h:inputText id="input_email" value="#{myBean.email}"

            required="true" validator="#{myBean.validateEmail}" requiredMessage="e-mail needed" autocomplete="off">


            <rich:ajaxValidator event="onchange"/>
            </h:inputText>
            <rich:message for="input_email">
            <f:facet name="passedMarker">
            <h:graphicImage url="/image/passed.png"/>
            </f:facet>
            </rich:message>

             

            <h:outputLabel value="name"/>
            <h:inputText id="input_name" value="#{myBean.name}" required="true" validator="#{myBean.validateName}" requiredMessage="name needed" autocomplete="off">
            <rich:ajaxValidator event="onchange"/>
            </h:inputText>
            <rich:message for="input_name">
            <f:facet name="passedMarker">
            <h:graphicImage url="/image/passed.png"/>
            </f:facet>
            </rich:message>

             

            </h:form>{code}

             

            When the form is rendered, then the passedMarkers are instantly shown - is that normal?

             

            I would except that a passedMarker of a field is only shown after the field is validated

            (and the validation has no errors, that means: the field is passed).

             

            Message was edited by: nimo stephan

            • 3. Re: rich:message facet passedMarker
              nbelaevski

              Hi Nimo,

               

              This won't work neither for rich:messages nor for rich:message. Please take a look at https://jira.jboss.org/jira/browse/RF-764

              • 4. Re: rich:message facet passedMarker
                nimo22

                oh okay, got it.

                 

                thanks.