myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Myfaces Wiki] Update of "Create and Display Messages" by StephanStrittmatter
Date Fri, 07 Oct 2005 07:37:46 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Myfaces Wiki" for change notification.

The following page has been changed by StephanStrittmatter:
http://wiki.apache.org/myfaces/Create_and_Display_Messages

The comment on the change is:
Hint for Multilanguage Support added

------------------------------------------------------------------------------
  {{{
     // myBackingBean
     private transient UIInput externalCustomerLastNameInput;
+ 
     public UIInput getExternalCustomerLastNameInput()
     {
         return this.externalCustomerLastNameInput;
@@ -36, +37 @@

         this.externalCustomerLastNameInput = externalCustomerLastNameInput;
     }
  
- facesContext.addMessage(externalCustomerLastNameInput.getClientId(facesContext),
+    facesContext.addMessage(externalCustomerLastNameInput.getClientId(facesContext),
       new FacesMessage(FacesMessage.SEVERITY_ERROR,
           "Last name mismatch", "The last name doesn't match the record found."));
- 
+ }}}
+ {{{
  <h:outputLabel for="ExternalCustomerLastNameInput">
     <h:outputText value="Customer Last Name:"/>
  </h:outputLabel>
@@ -49, +51 @@

  <h:message for="ExternalCustomerLastNameInput" styleClass="errors" showDetail="true"/>
  }}}
  
+ === Multilanguage Support ===
+ There is a helper class {{{MessageUtil}}} which allows to set language dependent messages:
+ {{{
+ FacesMessage message = org.apache.myfaces.util.MessageUtils.getMessage(FacesMessage.Severity
severity, String bundleBaseName, String messageId, Object params[]);
+ }}}
+ The language is taken from the {{{FacesContext}}}.
+ 

Mime
View raw message