2 Replies Latest reply on Sep 20, 2010 7:47 AM by chalu

    rich:message is not rendered on linux

    chalu

      Hello,

      I have a registration form:

      <h:form>

      ...

      <h:panelGroup>
      <h:outputText value="#{messages.registration_password}" />
      <h:outputText value="*" style="color:#ff0000;"/>
      </h:panelGroup>
      <h:panelGroup>
      <h:inputSecret id="password" value="#{regForm.password}" styleClass="inputbox"/>
      <rich:message for="password">
                              <f:facet name="errorMarker">
                                  <h:graphicImage value="/imgs/error.gif" />  
                              </f:facet>
                      </rich:message>
      </h:panelGroup>

      <h:panelGroup>

      <h:outputText value="#{messages.registration_password}" />

      <h:outputText value="*" style="color:#ff0000;"/>

      </h:panelGroup>

      <h:panelGroup>

      <h:inputSecret id="password" value="#{regForm.password}" styleClass="inputbox"/>

      <rich:message for="password">

                     <f:facet name="errorMarker">

                       <h:graphicImage value="/imgs/error.gif" />  

                     </f:facet>

              </rich:message>

      </h:panelGroup>

       

      And in my backing bean:

      public String register() throws Exception{

      //log.info("registration data: "+toString());

      try{

      if(this.validateData()){

      ...

       

      private boolean validateData() throws Exception {

          boolean status = true;

          ctx = FacesContext.getCurrentInstance();

          mf = new MessageFactory();

      ...

      if((password.trim().length())<5 || (password.length())>25){

            ctx.addMessage("password", new FacesMessage(FacesMessage.SEVERITY_ERROR,

          mf.getMessage("registration_errorLength_5_25"), null));

            status = false;

          }

       

       

      So, when I try it on my dev machine with windows, it works.

      When I deploy it into linux machine, message and the rest of page is not rendered and stays empty.

       

      In my log I have:

      [javax.enterprise.resource.webcontainer.jsf.lifecycle] (ajp-127.0.0.1-8009-5) WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.

      sourceId=password[severity=(ERROR 2), summary=(DÊlka musà být mezi 5 a 25 znaky), detail=(DÊlka musà být mezi 5 a 25 znaky)]

      Have I do something by wrong or unrecommended way?
      I need validation message localized, so I use it by this way and not e.g. <f:validateLength minimum="5" />
      Thanks, Jiri

        • 1. Re: rich:message is not rendered on linux
          sivaprasad9394

          try like this,

           

          <a4j:outputPanel id="SomeId" ajaxRendered="true">

          <rich:message for="password">

                         <f:facet name="errorMarker">

                           <h:graphicImage value="/imgs/error.gif" /> 

                         </f:facet>

                  </rich:message>

          </a4j:outputPanel>

          • 2. Re: rich:message is not rendered on linux
            chalu

            Unfortunatelly, no any change. Messages are still not displayed.

             

            Alternativelly, is there any chance to localize validator messages? something as:

             

            <h:inputText id="firstName" value="#{regForm.firstName}" styleClass="inputbox">
            <f:validateLength minimum="10" maximum="25" summary="#{messages.registration_errorLength_1_25}"/>
                                <rich:ajaxValidator event="onblur"/>
                            </h:inputText>
            <rich:message for="firstName" styleClass="error" />

            <h:inputText id="firstName" value="#{regForm.firstName}" styleClass="inputbox">

            <f:validateLength minimum="10" maximum="25" summary="#{messages.registration_errorLength_1_25}"/>

                    <rich:ajaxValidator event="onblur"/>

            </h:inputText>

            <rich:message for="firstName" styleClass="error" />