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 RickReumann
Date Fri, 09 Sep 2005 15:45:04 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 RickReumann:
http://wiki.apache.org/myfaces/Create_and_Display_Messages

------------------------------------------------------------------------------
  '''From Mike Kienenberger, posted on MyFaces mailing list:'''
  
+ {{{
  <h:messages globalOnly="true" showDetail="true"/>
  <h:message for="<optionalRelatedComponentId>" showDetail="true"/>
  
@@ -10, +11 @@

  facesContext.addMessage(<optionalRelatedComponentReference>.getClientId(facesContext),
                     new FacesMessage(FacesMessage.SEVERITY_<WHATEVER>,
                         "<messageSummary>", "<messageDetail>"));
+ }}}
  
  optionalRelatedComponentReference.getClientId(facesContext) can be
  replaced with null if you want a global message.
@@ -22, +24 @@

  for input components that might change between inputCalendars or
  pulldowns or inputText fields, it's very helpful.
  
+ {{{
     private transient UIInput externalCustomerLastNameInput;
     public UIInput getExternalCustomerLastNameInput()
     {
         return this.externalCustomerLastNameInput;
     }
+    public void setExternalCustomerLastNameInput(UIInput externalCustomerLastNameInput)
-    public void setExternalCustomerLastNameInput(
-            UIInput externalCustomerLastNameInput)
     {
         this.externalCustomerLastNameInput = externalCustomerLastNameInput;
     }
  
  facesContext.addMessage(externalCustomerLastNameInput.getClientId(facesContext),
-                    new FacesMessage(FacesMessage.SEVERITY_ERROR,
+      new FacesMessage(FacesMessage.SEVERITY_ERROR,
+          "Last name mismatch", "The last name doesn't match the record found."));
-                        "Last name mismatch", "The last name doesn't
- match the record found."));
  
  <h:outputLabel for="ExternalCustomerLastNameInput">
     <h:outputText value="Customer Last Name:"/>
@@ -44, +45 @@

  <h:inputText id="ExternalCustomerLastNameInput"
     binding="#{page.externalCustomerLastNameInput}"
     value="#{dataModel.externalCustomerLastName}"/>
- <h:message for="ExternalCustomerLastNameInput" styleClass="errors"
+ <h:message for="ExternalCustomerLastNameInput" styleClass="errors" showDetail="true"/>
- showDetail="true"/>
+ }}}
  

Mime
View raw message