Uploaded image for project: 'RichFaces'
  1. RichFaces
  2. RF-4428

3.2.2.CR4: ajaxValidator doesn't find ValidatorMessages.properties

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 3.2.2
    • Fix Version/s: 3.3.2.CR1
    • Component/s: component-misc
    • Labels:
      None
    • Environment:

      RF 3.2.2.CR4, JSF 1.2_09, JBoss 4.2.3, Hibernate Validator 3.1.0.CR2, JDK 1.6.0_07

      Description

      I have this entity class:
      public class Kunde implements java.io.Serializable {
      @Column(length=NACHNAME_LENGTH_MAX)
      @NotNull(message="

      {kundenverwaltung.kunde.nachname.notNull}

      ")
      @Length(min=NACHNAME_LENGTH_MIN, max=NACHNAME_LENGTH_MAX, message="

      {kundenverwaltung.kunde.nachname.length}

      ")
      @Pattern(regex=NACHNAME_PATTERN, message="

      {kundenverwaltung.kunde.nachname.pattern}

      ")
      @XmlElement(required=true)
      protected String nachname = "";
      ...}

      The message keys like kundenverwaltung.kunde.nachname.length are declared in ValidatorMessages.properties and ValidatorMessages_de.properties. Both files are in the root of an EAR file. When doing Hibernate validation within the EJB module (resp. .jar file) there is no problem: the messages are picked up in the right language.

      However, when changing an xhtml page to use the new rich:ajaxValidator like the following fragment, then only a message pops up containing the message key, e.g. kundenverwaltung.kunde.nachname.length (see above).

      <h:form id="createForm">
      <a4j:region>
      <h:panelGrid id="panelGrid" columns="3" columnClasses="kundendetailsBezeichner, kundendetailsDaten">
      <h:outputLabel value="#

      {i18n['createEinenKunden.nachname']}

      " for="nachname"/>
      <h:inputText id="nachname"
      value="#

      {kv.neuerFirmenkunde.nachname}

      "
      required="true"
      requiredMessage="#

      {i18n['createEinenKunden.nachname.required']}

      ">
      <rich:ajaxValidator event="onblur" reRender="fehlermeldungNachname"/>
      </h:inputText>
      <rich:message id="fehlermeldungNachname" for="nachname" errorClass="error" showSummary="true" showDetail="true">
      <f:facet name="errorMarker">
      <h:graphicImage url="/images/error.gif"/>
      </f:facet>
      </rich:message>

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                alexsmirnov Alexander Smirnov
                Reporter:
                juergen.zimmermann Juergen Zimmermann
              • Votes:
                1 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: