myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmarinsc...@apache.org
Subject cvs commit: incubator-myfaces/webapps/examples/web selectbox.jsp validate.jsp
Date Sat, 22 Jan 2005 19:47:45 GMT
mmarinschek    2005/01/22 11:47:45

  Modified:    src/components/org/apache/myfaces/component/html/ext
                        HtmlMessage.java HtmlMessage.xml HtmlMessages.java
                        HtmlMessages.xml
               src/components/org/apache/myfaces/renderkit/html/ext
                        HtmlMessageRenderer.java HtmlMessagesRenderer.java
               src/components/org/apache/myfaces/taglib/html/ext
                        HtmlMessageTag.java HtmlMessagesTag.java
               src/share/org/apache/myfaces/renderkit/html
                        HtmlMessageRendererBase.java
               tlds     myfaces_ext.tld
               webapps/examples/web selectbox.jsp validate.jsp
  Log:
  Message rendering updated - if a validation exception needs to be rendered, the id of the
component is replaced with a label.
  
  Revision  Changes    Path
  1.10      +22 -3     incubator-myfaces/src/components/org/apache/myfaces/component/html/ext/HtmlMessage.java
  
  Index: HtmlMessage.java
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/components/org/apache/myfaces/component/html/ext/HtmlMessage.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- HtmlMessage.java	16 Jan 2005 20:09:53 -0000	1.9
  +++ HtmlMessage.java	22 Jan 2005 19:47:44 -0000	1.10
  @@ -26,6 +26,9 @@
    * @author Manfred Geiler (latest modification by $Author$)
    * @version $Revision$ $Date$
    * $Log$
  + * Revision 1.10  2005/01/22 19:47:44  mmarinschek
  + * Message rendering updated - if a validation exception needs to be rendered, the id of
the component is replaced with a label.
  + *
    * Revision 1.9  2005/01/16 20:09:53  matzew
    * added patch form Sean Schofield. forceId for reuse of "legacy JavaScript" (MyFaces-70)
    *
  @@ -78,6 +81,7 @@
       private String _detailFormat = null;
       private String _enabledOnUserRole = null;
       private String _visibleOnUserRole = null;
  +    private Boolean _replaceIdWithLabel = null;
   
       public HtmlMessage()
       {
  @@ -133,6 +137,19 @@
           return vb != null ? (String)vb.getValue(getFacesContext()) : null;
       }
   
  +    public void setReplaceIdWithLabel(boolean replaceIdWithLabel)
  +    {
  +        _replaceIdWithLabel = Boolean.valueOf(replaceIdWithLabel);
  +    }
  +
  +    public boolean isReplaceIdWithLabel()
  +    {
  +        if (_replaceIdWithLabel != null) return _replaceIdWithLabel.booleanValue();
  +        ValueBinding vb = getValueBinding("replaceIdWithLabel");
  +        Boolean v = vb != null ? (Boolean)vb.getValue(getFacesContext()) : null;
  +        return v != null ? v.booleanValue() : false;
  +    }
  +
   
       public boolean isRendered()
       {
  @@ -142,12 +159,13 @@
   
       public Object saveState(FacesContext context)
       {
  -        Object values[] = new Object[5];
  +        Object values[] = new Object[6];
           values[0] = super.saveState(context);
           values[1] = _summaryFormat;
           values[2] = _detailFormat;
           values[3] = _enabledOnUserRole;
           values[4] = _visibleOnUserRole;
  +        values[5] = _replaceIdWithLabel;
           return ((Object) (values));
       }
   
  @@ -159,6 +177,7 @@
           _detailFormat = (String)values[2];
           _enabledOnUserRole = (String)values[3];
           _visibleOnUserRole = (String)values[4];
  +        _replaceIdWithLabel = (Boolean)values[5];
       }
       //------------------ GENERATED CODE END ---------------------------------------
   }
  
  
  
  1.8       +4 -0      incubator-myfaces/src/components/org/apache/myfaces/component/html/ext/HtmlMessage.xml
  
  Index: HtmlMessage.xml
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/components/org/apache/myfaces/component/html/ext/HtmlMessage.xml,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- HtmlMessage.xml	29 Oct 2004 15:50:59 -0000	1.7
  +++ HtmlMessage.xml	22 Jan 2005 19:47:44 -0000	1.8
  @@ -23,4 +23,8 @@
           <name>visibleOnUserRole</name>
           <type>java.lang.String</type>
       </field>
  +    <field>
  +        <name>replaceIdWithLabel</name>
  +        <type>boolean</type>
  +    </field>
   </component>
  
  
  
  1.10      +19 -3     incubator-myfaces/src/components/org/apache/myfaces/component/html/ext/HtmlMessages.java
  
  Index: HtmlMessages.java
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/components/org/apache/myfaces/component/html/ext/HtmlMessages.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- HtmlMessages.java	16 Jan 2005 20:09:53 -0000	1.9
  +++ HtmlMessages.java	22 Jan 2005 19:47:44 -0000	1.10
  @@ -52,6 +52,7 @@
       private String _detailFormat = null;
       private String _enabledOnUserRole = null;
       private String _visibleOnUserRole = null;
  +    private Boolean _replaceIdWithLabel = null;
   
       public HtmlMessages()
       {
  @@ -119,6 +120,19 @@
           return vb != null ? (String)vb.getValue(getFacesContext()) : null;
       }
   
  +    public void setReplaceIdWithLabel(boolean replaceIdWithLabel)
  +    {
  +        _replaceIdWithLabel = Boolean.valueOf(replaceIdWithLabel);
  +    }
  +
  +    public boolean isReplaceIdWithLabel()
  +    {
  +        if (_replaceIdWithLabel != null) return _replaceIdWithLabel.booleanValue();
  +        ValueBinding vb = getValueBinding("replaceIdWithLabel");
  +        Boolean v = vb != null ? (Boolean)vb.getValue(getFacesContext()) : null;
  +        return v != null ? v.booleanValue() : false;
  +    }
  +
   
       public boolean isRendered()
       {
  @@ -128,13 +142,14 @@
   
       public Object saveState(FacesContext context)
       {
  -        Object values[] = new Object[6];
  +        Object values[] = new Object[7];
           values[0] = super.saveState(context);
           values[1] = _summaryFormat;
           values[2] = _globalSummaryFormat;
           values[3] = _detailFormat;
           values[4] = _enabledOnUserRole;
           values[5] = _visibleOnUserRole;
  +        values[6] = _replaceIdWithLabel;
           return ((Object) (values));
       }
   
  @@ -147,6 +162,7 @@
           _detailFormat = (String)values[3];
           _enabledOnUserRole = (String)values[4];
           _visibleOnUserRole = (String)values[5];
  +        _replaceIdWithLabel = (Boolean)values[6];
       }
       //------------------ GENERATED CODE END ---------------------------------------
   }
  
  
  
  1.8       +4 -0      incubator-myfaces/src/components/org/apache/myfaces/component/html/ext/HtmlMessages.xml
  
  Index: HtmlMessages.xml
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/components/org/apache/myfaces/component/html/ext/HtmlMessages.xml,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- HtmlMessages.xml	29 Oct 2004 15:50:59 -0000	1.7
  +++ HtmlMessages.xml	22 Jan 2005 19:47:44 -0000	1.8
  @@ -27,4 +27,8 @@
           <name>visibleOnUserRole</name>
           <type>java.lang.String</type>
       </field>
  +    <field>
  +        <name>replaceIdWithLabel</name>
  +        <type>boolean</type>
  +    </field>
   </component>
  
  
  
  1.7       +69 -12    incubator-myfaces/src/components/org/apache/myfaces/renderkit/html/ext/HtmlMessageRenderer.java
  
  Index: HtmlMessageRenderer.java
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/components/org/apache/myfaces/renderkit/html/ext/HtmlMessageRenderer.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- HtmlMessageRenderer.java	13 Oct 2004 11:50:59 -0000	1.6
  +++ HtmlMessageRenderer.java	22 Jan 2005 19:47:44 -0000	1.7
  @@ -16,6 +16,7 @@
   package org.apache.myfaces.renderkit.html.ext;
   
   import org.apache.myfaces.component.html.ext.HtmlMessage;
  +import org.apache.myfaces.component.html.ext.HtmlMessages;
   import org.apache.myfaces.renderkit.RendererUtils;
   import org.apache.myfaces.renderkit.html.HtmlMessageRendererBase;
   
  @@ -36,6 +37,9 @@
    * @author Manfred Geiler (latest modification by $Author$)
    * @version $Revision$ $Date$
    * $Log$
  + * Revision 1.7  2005/01/22 19:47:44  mmarinschek
  + * Message rendering updated - if a validation exception needs to be rendered, the id of
the component is replaced with a label.
  + *
    * Revision 1.6  2004/10/13 11:50:59  matze
    * renamed packages to org.apache
    *
  @@ -77,6 +81,16 @@
           String msgSummary = facesMessage.getSummary();
           if (msgSummary == null) return null;
   
  +        String inputLabel = null;
  +        if (msgClientId != null) inputLabel = findInputLabel(facesContext, msgClientId);
  +        if (inputLabel == null) inputLabel = "";
  +
  +        if(((message instanceof HtmlMessages && ((HtmlMessages) message).isReplaceIdWithLabel())
||
  +                (message instanceof HtmlMessage && ((HtmlMessage) message).isReplaceIdWithLabel()))&&
  +                inputLabel.length()!=0)
  +            msgSummary = msgSummary.replaceAll(findInputId(facesContext, msgClientId),inputLabel);
  +
  +
           String summaryFormat;
           if (message instanceof HtmlMessage)
           {
  @@ -89,11 +103,8 @@
   
           if (summaryFormat == null) return msgSummary;
   
  -        String inputLabel = null;
  -        if (msgClientId != null) inputLabel = findInputLabel(facesContext, msgClientId);
  -        if (inputLabel == null) inputLabel = "";
  -
           MessageFormat format = new MessageFormat(summaryFormat, facesContext.getViewRoot().getLocale());
  +
           return format.format(new Object[] {msgSummary, inputLabel});
       }
   
  @@ -105,6 +116,15 @@
           String msgDetail = facesMessage.getDetail();
           if (msgDetail == null) return null;
   
  +        String inputLabel = null;
  +        if (msgClientId != null) inputLabel = findInputLabel(facesContext, msgClientId);
  +        if (inputLabel == null) inputLabel = "";
  +
  +        if(((message instanceof HtmlMessages && ((HtmlMessages) message).isReplaceIdWithLabel())
||
  +                (message instanceof HtmlMessage && ((HtmlMessage) message).isReplaceIdWithLabel()))&&
  +                inputLabel.length()!=0)
  +            msgDetail = msgDetail.replaceAll(findInputId(facesContext, msgClientId),inputLabel);
  +
           String detailFormat;
           if (message instanceof HtmlMessage)
           {
  @@ -117,10 +137,6 @@
   
           if (detailFormat == null) return msgDetail;
   
  -        String inputLabel = null;
  -        if (msgClientId != null) inputLabel = findInputLabel(facesContext, msgClientId);
  -        if (inputLabel == null) inputLabel = "";
  -
           MessageFormat format = new MessageFormat(detailFormat, facesContext.getViewRoot().getLocale());
           return format.format(new Object[] {msgDetail, inputLabel});
       }
  @@ -129,7 +145,15 @@
       public static String findInputLabel(FacesContext facesContext, String inputClientId)
       {
           Map outputLabelMap = getOutputLabelMap(facesContext);
  -        return (String)outputLabelMap.get(inputClientId);
  +        MessageLabelInfo info = ((MessageLabelInfo)outputLabelMap.get(inputClientId));
  +        return info==null?null:info.getText();
  +    }
  +
  +    public static String findInputId(FacesContext facesContext, String inputClientId)
  +    {
  +        Map outputLabelMap = getOutputLabelMap(facesContext);
  +        MessageLabelInfo info = ((MessageLabelInfo)outputLabelMap.get(inputClientId));
  +        return info==null?null:(info.getForComponent()==null?null:info.getForComponent().getId());
       }
   
       /**
  @@ -167,7 +191,8 @@
                   else
                   {
                       map.put(input.getClientId(facesContext),
  -                            getLabelText(facesContext, (HtmlOutputLabel)child));
  +                            new MessageLabelInfo(
  +                                    input,getLabelText(facesContext, (HtmlOutputLabel)child)));
                   }
               }
               else
  @@ -185,5 +210,37 @@
               //TODO: traverse children and append OutputText and/or OutputMessage texts
           }
           return text;
  +    }
  +
  +    public static class MessageLabelInfo
  +    {
  +        private UIComponent _forComponent;
  +        private String _text;
  +
  +        public MessageLabelInfo(UIComponent forComponent, String text)
  +        {
  +            _forComponent = forComponent;
  +            _text = text;
  +        }
  +
  +        public UIComponent getForComponent()
  +        {
  +            return _forComponent;
  +        }
  +
  +        public void setForComponent(UIComponent forComponent)
  +        {
  +            _forComponent = forComponent;
  +        }
  +
  +        public String getText()
  +        {
  +            return _text;
  +        }
  +
  +        public void setText(String text)
  +        {
  +            _text = text;
  +        }
       }
   }
  
  
  
  1.6       +24 -10    incubator-myfaces/src/components/org/apache/myfaces/renderkit/html/ext/HtmlMessagesRenderer.java
  
  Index: HtmlMessagesRenderer.java
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/components/org/apache/myfaces/renderkit/html/ext/HtmlMessagesRenderer.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- HtmlMessagesRenderer.java	13 Oct 2004 11:50:59 -0000	1.5
  +++ HtmlMessagesRenderer.java	22 Jan 2005 19:47:44 -0000	1.6
  @@ -29,6 +29,9 @@
    * @author Manfred Geiler (latest modification by $Author$)
    * @version $Revision$ $Date$
    * $Log$
  + * Revision 1.6  2005/01/22 19:47:44  mmarinschek
  + * Message rendering updated - if a validation exception needs to be rendered, the id of
the component is replaced with a label.
  + *
    * Revision 1.5  2004/10/13 11:50:59  matze
    * renamed packages to org.apache
    *
  @@ -66,6 +69,16 @@
           String msgSummary = facesMessage.getSummary();
           if (msgSummary == null) return null;
   
  +        String inputLabel = null;
  +        if (msgClientId != null) inputLabel = HtmlMessageRenderer.findInputLabel(facesContext,
msgClientId);
  +        if (inputLabel == null) inputLabel = "";
  +
  +        if(((message instanceof HtmlMessages && ((HtmlMessages) message).isReplaceIdWithLabel())
||
  +                (message instanceof HtmlMessage && ((HtmlMessage) message).isReplaceIdWithLabel()))&&
  +                inputLabel.length()!=0)
  +            msgSummary = msgSummary.replaceAll(HtmlMessageRenderer.findInputId(facesContext,
msgClientId),inputLabel);
  +
  +
           String summaryFormat;
           if (msgClientId == null)
           {
  @@ -81,10 +94,6 @@
           }
           if (summaryFormat == null) return msgSummary;
   
  -        String inputLabel = null;
  -        if (msgClientId != null) inputLabel = HtmlMessageRenderer.findInputLabel(facesContext,
msgClientId);
  -        if (inputLabel == null) inputLabel = "";
  -
           MessageFormat format = new MessageFormat(summaryFormat, facesContext.getViewRoot().getLocale());
           return format.format(new Object[] {msgSummary, inputLabel});
       }
  @@ -122,6 +131,15 @@
           String msgDetail = facesMessage.getDetail();
           if (msgDetail == null) return null;
   
  +        String inputLabel = null;
  +        if (msgClientId != null) inputLabel = HtmlMessageRenderer.findInputLabel(facesContext,
msgClientId);
  +        if (inputLabel == null) inputLabel = "";
  +
  +        if(((message instanceof HtmlMessages && ((HtmlMessages) message).isReplaceIdWithLabel())
||
  +                (message instanceof HtmlMessage && ((HtmlMessage) message).isReplaceIdWithLabel()))&&
  +                inputLabel.length()!=0)
  +            msgDetail = msgDetail.replaceAll(HtmlMessageRenderer.findInputId(facesContext,
msgClientId),inputLabel);
  +
           String detailFormat;
           if (message instanceof HtmlMessage)
           {
  @@ -133,10 +151,6 @@
           }
   
           if (detailFormat == null) return msgDetail;
  -
  -        String inputLabel = null;
  -        if (msgClientId != null) inputLabel = HtmlMessageRenderer.findInputLabel(facesContext,
msgClientId);
  -        if (inputLabel == null) inputLabel = "";
   
           MessageFormat format = new MessageFormat(detailFormat, facesContext.getViewRoot().getLocale());
           return format.format(new Object[] {msgDetail, inputLabel});
  
  
  
  1.9       +12 -2     incubator-myfaces/src/components/org/apache/myfaces/taglib/html/ext/HtmlMessageTag.java
  
  Index: HtmlMessageTag.java
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/components/org/apache/myfaces/taglib/html/ext/HtmlMessageTag.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- HtmlMessageTag.java	13 Oct 2004 11:50:59 -0000	1.8
  +++ HtmlMessageTag.java	22 Jan 2005 19:47:44 -0000	1.9
  @@ -25,6 +25,9 @@
    * @author Manfred Geiler (latest modification by $Author$)
    * @version $Revision$ $Date$
    * $Log$
  + * Revision 1.9  2005/01/22 19:47:44  mmarinschek
  + * Message rendering updated - if a validation exception needs to be rendered, the id of
the component is replaced with a label.
  + *
    * Revision 1.8  2004/10/13 11:50:59  matze
    * renamed packages to org.apache
    *
  @@ -69,6 +72,7 @@
       private String _detailFormat;
       private String _enabledOnUserRole;
       private String _visibleOnUserRole;
  +    private String _replaceIdWithLabel;
   
       protected void setProperties(UIComponent component)
       {
  @@ -78,6 +82,7 @@
           setStringProperty(component, "detailFormat", _detailFormat);
           setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole);
           setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole);
  +        setBooleanProperty(component, "replaceIdWithLabel",_replaceIdWithLabel==null?Boolean.TRUE.toString():_replaceIdWithLabel);
       }
   
       public void setSummaryFormat(String summaryFormat)
  @@ -98,5 +103,10 @@
       public void setVisibleOnUserRole(String visibleOnUserRole)
       {
           _visibleOnUserRole = visibleOnUserRole;
  +    }
  +
  +    public void setReplaceIdWithLabel(String replaceIdWithLabel)
  +    {
  +        _replaceIdWithLabel = replaceIdWithLabel;
       }
   }
  
  
  
  1.9       +12 -2     incubator-myfaces/src/components/org/apache/myfaces/taglib/html/ext/HtmlMessagesTag.java
  
  Index: HtmlMessagesTag.java
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/components/org/apache/myfaces/taglib/html/ext/HtmlMessagesTag.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- HtmlMessagesTag.java	13 Oct 2004 11:50:59 -0000	1.8
  +++ HtmlMessagesTag.java	22 Jan 2005 19:47:44 -0000	1.9
  @@ -26,6 +26,9 @@
    * @author Manfred Geiler (latest modification by $Author$)
    * @version $Revision$ $Date$
    * $Log$
  + * Revision 1.9  2005/01/22 19:47:44  mmarinschek
  + * Message rendering updated - if a validation exception needs to be rendered, the id of
the component is replaced with a label.
  + *
    * Revision 1.8  2004/10/13 11:50:59  matze
    * renamed packages to org.apache
    *
  @@ -65,6 +68,7 @@
       private String _detailFormat;
       private String _enabledOnUserRole;
       private String _visibleOnUserRole;
  +    private String _replaceIdWithLabel;
   
       protected void setProperties(UIComponent component)
       {
  @@ -75,6 +79,7 @@
           setStringProperty(component, "detailFormat", _detailFormat);
           setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole);
           setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole);
  +        setBooleanProperty(component, "replaceIdWithLabel",_replaceIdWithLabel==null?Boolean.TRUE.toString():_replaceIdWithLabel);
       }
   
       public void setSummaryFormat(String summaryFormat)
  @@ -100,5 +105,10 @@
       public void setVisibleOnUserRole(String visibleOnUserRole)
       {
           _visibleOnUserRole = visibleOnUserRole;
  +    }
  +
  +    public void setReplaceIdWithLabel(String replaceIdWithLabel)
  +    {
  +        _replaceIdWithLabel = replaceIdWithLabel;
       }
   }
  
  
  
  1.11      +9 -4      incubator-myfaces/src/share/org/apache/myfaces/renderkit/html/HtmlMessageRendererBase.java
  
  Index: HtmlMessageRendererBase.java
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/share/org/apache/myfaces/renderkit/html/HtmlMessageRendererBase.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- HtmlMessageRendererBase.java	23 Dec 2004 13:03:09 -0000	1.10
  +++ HtmlMessageRendererBase.java	22 Jan 2005 19:47:44 -0000	1.11
  @@ -34,6 +34,9 @@
    * @author Manfred Geiler (latest modification by $Author$)
    * @version $Revision$ $Date$
    * $Log$
  + * Revision 1.11  2005/01/22 19:47:44  mmarinschek
  + * Message rendering updated - if a validation exception needs to be rendered, the id of
the component is replaced with a label.
  + *
    * Revision 1.10  2004/12/23 13:03:09  mmarinschek
    * id's not rendered (or not conditionally rendered); changes in jslistener to support
both ie and firefox now
    *
  @@ -99,7 +102,9 @@
               throw new FacesException("Could not render Message. Unable to find component
'" + forAttr + "' (calling findComponent on component '" + message.getClientId(facesContext)
+ "')");
           }
   
  -        Iterator messageIterator = facesContext.getMessages(forComponent.getClientId(facesContext));
  +        String clientId = forComponent.getClientId(facesContext);
  +
  +        Iterator messageIterator = facesContext.getMessages(clientId);
           if (!messageIterator.hasNext())
           {
               // No associated message, nothing to render
  @@ -110,7 +115,7 @@
           FacesMessage facesMessage = (FacesMessage)messageIterator.next();
   
           // and render it
  -        renderSingleFacesMessage(facesContext, message, facesMessage, null);
  +        renderSingleFacesMessage(facesContext, message, facesMessage, clientId);
       }
   
   
  
  
  
  1.155     +19 -0     incubator-myfaces/tlds/myfaces_ext.tld
  
  Index: myfaces_ext.tld
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/tlds/myfaces_ext.tld,v
  retrieving revision 1.154
  retrieving revision 1.155
  diff -u -r1.154 -r1.155
  --- myfaces_ext.tld	18 Jan 2005 00:16:10 -0000	1.154
  +++ myfaces_ext.tld	22 Jan 2005 19:47:45 -0000	1.155
  @@ -255,6 +255,16 @@
                   Example: "The input in field {1} is wrong: {0}"
               </description>
           </attribute>
  +        <attribute>
  +            <name>replaceIdWithLabel</name>
  +            <required>false</required>
  +            <rtexprvalue>false</rtexprvalue>
  +            <description>
  +                If present, all occurrences of the id of the component for which the message
  +                is rendered will be replaced by the label. Standard is true for the extended
  +                message renderer.
  +            </description>
  +        </attribute>
       </tag>
   
       <!-- messages -->
  @@ -301,6 +311,15 @@
                   called with the message detail as the first argument and the label of the
                   associated component (if any) as the second argument.
                   Example: "The input in field {1} is wrong: {0}"
  +            </description>
  +        </attribute>
  +        <attribute>
  +            <name>replaceIdWithLabel</name>
  +            <required>false</required>
  +            <rtexprvalue>false</rtexprvalue>
  +            <description>
  +                If present, all occurrences of the id of the component for which the message
  +                is rendered will be replaced by the label.
               </description>
           </attribute>
       </tag>
  
  
  
  1.44      +1 -1      incubator-myfaces/webapps/examples/web/selectbox.jsp
  
  Index: selectbox.jsp
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/webapps/examples/web/selectbox.jsp,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- selectbox.jsp	19 Jan 2005 13:18:04 -0000	1.43
  +++ selectbox.jsp	22 Jan 2005 19:47:45 -0000	1.44
  @@ -61,7 +61,7 @@
           <f:facet name="body">
               <h:panelGroup id="body">
   
  -                <x:messages id="messageList" styleClass="error" showDetail="true" summaryFormat="{0}
" />
  +                <x:messages id="messageList" styleClass="error" showDetail="true" summaryFormat="{0}
"/>
   
                   <h:form name="formName">
   
  
  
  
  1.16      +15 -15    incubator-myfaces/webapps/examples/web/validate.jsp
  
  Index: validate.jsp
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/webapps/examples/web/validate.jsp,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- validate.jsp	20 Nov 2004 20:18:47 -0000	1.15
  +++ validate.jsp	22 Jan 2005 19:47:45 -0000	1.16
  @@ -63,45 +63,45 @@
   			<h:form id="form1" name="validateForm">
   			   <h:panelGrid columns="3">
   
  -					<h:outputLabel for="form1:email" value="#{example_messages['validate_email']}"
/>
  +					<h:outputLabel for="email" value="#{example_messages['validate_email']}" />
                       <h:inputText id="email" value="#{validateForm.email}" required="true">
                           <f:validator validatorId="org.apache.myfaces.validator.Email"/>
                       </h:inputText>
  -					<h:message id="emailError" for="form1:email" styleClass="error" />
  +					<x:message id="emailError" for="email" styleClass="error" />
   
  -					<h:outputLabel for="form1:email2" value="#{example_messages['validate_email']}2"
/>
  +					<h:outputLabel for="email2" value="#{example_messages['validate_email']}2" />
                       <h:inputText id="email2" value="#{validateForm.email2}" required="true">
                           <x:validateEmail />
                       </h:inputText>
  -					<h:message id="emailError2" for="form1:email2" styleClass="error" />
  +					<x:message id="emailError2" for="email2" styleClass="error" />
   
  -					<h:outputLabel for="form1:creditCardNumber" value="#{example_messages['validate_credit']}"
/>
  +					<h:outputLabel for="creditCardNumber" value="#{example_messages['validate_credit']}"
/>
                       <h:inputText id="creditCardNumber" value="#{validateForm.creditCardNumber}"
required="true">
                           <x:validateCreditCard />
                       </h:inputText>
  -					<h:message id="creditCardNumberError" for="form1:creditCardNumber" styleClass="error"
/>
  +					<x:message id="creditCardNumberError" for="creditCardNumber" styleClass="error"
/>
   
  -                         <h:outputLabel for="form1:regExprValue" value="#{example_messages['validate_regexp']}"
/>
  +                         <h:outputLabel for="regExprValue" value="#{example_messages['validate_regexp']}"
/>
                       <h:inputText id="regExprValue" value="#{validateForm.regExpr}" required="true">
                           <x:validateRegExpr pattern='\d{5}' />
                       </h:inputText>
  -                         <h:message id="regExprValueError" for="form1:regExprValue"
styleClass="error" />
  +                         <x:message id="regExprValueError" for="regExprValue" styleClass="error"
/>
   
  -                         <h:outputLabel for="form1:isbn" value="#{example_messages['validate_isbn']}"
/>
  +                         <h:outputLabel for="isbn" value="#{example_messages['validate_isbn']}"
/>
                       <h:inputText id="isbn" value="#{validateForm.isbn}" required="true">
                           <x:validateISBN />
                       </h:inputText>
  -                         <h:message id="isbnError" for="form1:isbn" styleClass="error"
/>
  +                         <x:message id="isbnError" for="isbn" styleClass="error" />
   
  -					<h:outputLabel for="form1:equal" value="#{example_messages['validate_equal']}"
/>
  +					<h:outputLabel for="equal" value="#{example_messages['validate_equal']}" />
                       <h:inputText id="equal" value="#{validateForm.equal}" required="true"/>
  -					<h:message id="equalError" for="form1:equal" styleClass="error" />
  +					<x:message id="equalError" for="equal" styleClass="error" />
   
  -					<h:outputLabel for="form1:equal2" value="#{example_messages['validate_equal']}2"
/>
  +					<h:outputLabel for="equal2" value="#{example_messages['validate_equal']}2" />
                       <h:inputText id="equal2" value="#{validateForm.equal2}" required="true">
  -                        <x:validateEqual for="form1:equal" />
  +                        <x:validateEqual for="equal" />
                       </h:inputText>
  -					<h:message id="equal2Error" for="form1:equal2" styleClass="error" />
  +					<x:message id="equal2Error" for="equal2" styleClass="error" />
   
                       <h:panelGroup/>
   				    <h:commandButton id="validateButton" value="#{example_messages['button_submit']}"
action="#{validateForm.submit}"/>
  
  
  

Mime
View raw message