You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Andrew Robinson (JIRA)" <de...@myfaces.apache.org> on 2007/08/31 23:11:19 UTC

[jira] Resolved: (TRINIDAD-653) PanelLabelAndMessageRenderer shouldn't need the "for" given to detect what it is for

     [ https://issues.apache.org/jira/browse/TRINIDAD-653?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Robinson resolved TRINIDAD-653.
--------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.0.3-core

Committed revision 571586.

> PanelLabelAndMessageRenderer shouldn't need the "for" given to detect what it is for
> ------------------------------------------------------------------------------------
>
>                 Key: TRINIDAD-653
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-653
>             Project: MyFaces Trinidad
>          Issue Type: Improvement
>    Affects Versions: 1.0.2-core
>            Reporter: Andrew Robinson
>            Assignee: Andrew Robinson
>             Fix For: 1.0.3-core
>
>
> Since CorePanelLabelAndMessage will usually be used having the first child component as the input, the renderer should be able to determine the "for" attribute value without it being specified. Here is code that can be used in the PanelLabelAndMessageRenderer:
>   @Override
>   protected String getLabelFor(FacesContext context, RenderingContext arc,
>     UIComponent component, FacesBean bean)
>   {
>     String forValue = getFor(bean);
>     String val = MessageUtils.getClientIdFor(context, component, forValue);
>     if (val == null)
>     {
>       if (component.getChildCount() > 0)
>       {
>         UIComponent firstChild = (UIComponent)component.getChildren().get(0);
>         if (firstChild instanceof EditableValueHolder)
>         {
>           val = firstChild.getClientId(context);
>         }
>       }
>     }
>     return val;
>   }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Resolved: (TRINIDAD-653) PanelLabelAndMessageRenderer shouldn't need the "for" given to detect what it is for

Posted by Zubin Wadia <zw...@gmail.com>.
On 8/31/07, Zubin Wadia <zw...@gmail.com> wrote:
> On 8/31/07, Andrew Robinson (JIRA) <de...@myfaces.apache.org> wrote:
> >
> >      [
> >
> https://issues.apache.org/jira/browse/TRINIDAD-653?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
> > ]
> >
> > Andrew Robinson resolved TRINIDAD-653.
> > --------------------------------------
> >
> >        Resolution: Fixed
> >     Fix Version/s: 1.0.3-core
> >
> > Committed revision 571586.
> >
> > > PanelLabelAndMessageRenderer shouldn't need the "for" given to detect
> what
> > it is for
> > >
> >
> ------------------------------------------------------------------------------------
> > >
> > >                 Key: TRINIDAD-653
> > >                 URL: https://issues.apache.org/jira/browse/TRINIDAD-653
> > >             Project: MyFaces Trinidad
> > >          Issue Type: Improvement
> > >    Affects Versions: 1.0.2-core
> > >            Reporter: Andrew Robinson
> > >            Assignee: Andrew Robinson
> > >             Fix For: 1.0.3-core
> > >
> > >
> > > Since CorePanelLabelAndMessage will usually be used having the first
> child
> > component as the input, the renderer should be able to determine the "for"
> > attribute value without it being specified. Here is code that can be used
> in
> > the PanelLabelAndMessageRenderer:
> > >   @Override
> > >   protected String getLabelFor(FacesContext context, RenderingContext
> arc,
> > >     UIComponent component, FacesBean bean)
> > >   {
> > >     String forValue = getFor(bean);
> > >     String val = MessageUtils.getClientIdFor(context, component,
> > forValue);
> > >     if (val == null)
> > >     {
> > >       if (component.getChildCount() > 0)
> > >       {
> > >         UIComponent firstChild =
> > (UIComponent)component.getChildren().get(0);
> > >         if (firstChild instanceof EditableValueHolder)
> > >         {
> > >           val = firstChild.getClientId(context);
> > >         }
> > >       }
> > >     }
> > >     return val;
> > >   }
> >
> > --
> > This message is automatically generated by JIRA.
> > -
> > You can reply to this email to add a comment to the issue online.
> >
> >
>

Re: [jira] Resolved: (TRINIDAD-653) PanelLabelAndMessageRenderer shouldn't need the "for" given to detect what it is for

Posted by Zubin Wadia <zw...@gmail.com>.
On 8/31/07, Andrew Robinson (JIRA) <de...@myfaces.apache.org> wrote:
>
>      [
> https://issues.apache.org/jira/browse/TRINIDAD-653?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
> ]
>
> Andrew Robinson resolved TRINIDAD-653.
> --------------------------------------
>
>        Resolution: Fixed
>     Fix Version/s: 1.0.3-core
>
> Committed revision 571586.
>
> > PanelLabelAndMessageRenderer shouldn't need the "for" given to detect what
> it is for
> >
> ------------------------------------------------------------------------------------
> >
> >                 Key: TRINIDAD-653
> >                 URL: https://issues.apache.org/jira/browse/TRINIDAD-653
> >             Project: MyFaces Trinidad
> >          Issue Type: Improvement
> >    Affects Versions: 1.0.2-core
> >            Reporter: Andrew Robinson
> >            Assignee: Andrew Robinson
> >             Fix For: 1.0.3-core
> >
> >
> > Since CorePanelLabelAndMessage will usually be used having the first child
> component as the input, the renderer should be able to determine the "for"
> attribute value without it being specified. Here is code that can be used in
> the PanelLabelAndMessageRenderer:
> >   @Override
> >   protected String getLabelFor(FacesContext context, RenderingContext arc,
> >     UIComponent component, FacesBean bean)
> >   {
> >     String forValue = getFor(bean);
> >     String val = MessageUtils.getClientIdFor(context, component,
> forValue);
> >     if (val == null)
> >     {
> >       if (component.getChildCount() > 0)
> >       {
> >         UIComponent firstChild =
> (UIComponent)component.getChildren().get(0);
> >         if (firstChild instanceof EditableValueHolder)
> >         {
> >           val = firstChild.getClientId(context);
> >         }
> >       }
> >     }
> >     return val;
> >   }
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>