[jsr-314-open-mirror] [jsr-314-open] Cannot call invokeOnComponent on UIColumn without rowIndex

Leonardo Uribe lu4242 at gmail.com
Wed Apr 28 08:33:06 EDT 2010


Hi

Should I create an issue on spec issue tracker for this one?

Any chance we can fix it for 1.2?

Can I commit this fix on myfaces or I have to wait?

regards,

Leonardo Uribe

2010/4/26 Martin Marinschek <mmarinschek at apache.org>

> Hi Leonardo,
>
> yes, ok - it is the same as the existing implementation, you are right
> - but still, I think we would only need to compare the part of the
> client-id which has not already been checked cause we have moved down
> the component tree already. But I see that this performance
> enhancement is not in the existing code, so forget my objection (or
> implement it and make it a little faster ;)
>
> Back to your original issue: I definitely agree.
>
> best regards,
>
> Martin
>
> On Mon, Apr 26, 2010 at 7:31 AM, Leonardo Uribe <lu4242 at gmail.com> wrote:
> > Hi Martin
> >
> > Yes, it is necessary to compare the full client id. Really that
> > part of the algorithm is the same as UIComponent.invokeOnComponent,
> > but without propagate the callback to the children.
> >
> > regards,
> >
> > Leonardo
> >
> > 2010/4/25 Martin Marinschek <mmarinschek at apache.org>
> >>
> >> Hi Leonardo,
> >>
> >> yes, certainly this needs to be doable as well. For performance
> >> reasons - is it really necessary to compare the full client-id?
> >>
> >> best regards,
> >>
> >> Martin
> >>
> >> On Fri, Apr 23, 2010 at 7:52 PM, Leonardo Uribe <lu4242 at gmail.com>
> wrote:
> >> > Hi
> >> >
> >> > Looking some jsf 2.0 code, I notice the current algorithm of
> >> > UIData.invokeOnComponent cannot handle the case when the target is a
> >> > UIColumn instance and no rowIndex is on clientId. Is that ok?
> >> >
> >> > Checking the new visit tree api, UIData.visitTree cleary says:
> >> >
> >> > "....If this component has children, for each UIColumn child:
> >> >
> >> > Call
> VisitContext.invokeVisitCallback(javax.faces.component.UIComponent,
> >> > javax.faces.component.visit.VisitCallback) on that UIColumn instance.
> If
> >> > such a call returns true, terminate visiting and return true from this
> >> > method.
> >> >
> >> > If the child UIColumn has facets, call
> >> > UIComponent.visitTree(javax.faces.component.visit.VisitContext,
> >> > javax.faces.component.visit.VisitCallback) on each one....."
> >> >
> >> > I think we should do something like this:
> >> >
> >> >                 for (Iterator<UIComponent> itChildren =
> >> > this.getChildren().iterator();
> >> >                         !returnValue && itChildren.hasNext();)
> >> >                 {
> >> >                     UIComponent child = itChildren.next();
> >> >                     if (child instanceof UIColumn &&
> >> > clientId.equals(child.getClientId()))
> >> >                     {
> >> >                         try {
> >> >                             callback.invokeContextCallback(context,
> >> > child);
> >> >                         } catch (Exception e) {
> >> >                             throw new FacesException(e);
> >> >                         }
> >> >                         returnValue = true;
> >> >                     }
> >> >                     // process the child's facets
> >> >                     for (Iterator<UIComponent> itChildFacets =
> >> > child.getFacets().values().iterator();
> >> >                             !returnValue && itChildFacets.hasNext();)
> >> >                     {
> >> >                         //recursive call to find the component
> >> >                         returnValue =
> >> > itChildFacets.next().invokeOnComponent(context, clientId, callback);
> >> >                     }
> >> >                 }
> >> >
> >> > Does that sounds reasonable? Should be fixed on 1.2.x branch too?
> >> >
> >> > regards,
> >> >
> >> > Leonardo Uribe
> >> >
> >> >
> >>
> >>
> >>
> >> --
> >>
> >> http://www.irian.at
> >>
> >> Your JSF powerhouse -
> >> JSF Consulting, Development and
> >> Courses in English and German
> >>
> >> Professional Support for Apache MyFaces
> >
> >
>
>
>
> --
>
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jsr-314-open-mirror/attachments/20100428/faa588f7/attachment-0002.html 


More information about the jsr-314-open-mirror mailing list