Hi Martin<br><br>Yes, it is necessary to compare the full client id. Really that <br>part of the algorithm is the same as UIComponent.invokeOnComponent,<br>but without propagate the callback to the children.<br><br>regards,<br>
<br>Leonardo<br><br><div class="gmail_quote">2010/4/25 Martin Marinschek <span dir="ltr"><<a href="mailto:mmarinschek@apache.org">mmarinschek@apache.org</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi Leonardo,<br>
<br>
yes, certainly this needs to be doable as well. For performance<br>
reasons - is it really necessary to compare the full client-id?<br>
<br>
best regards,<br>
<br>
Martin<br>
<div><div></div><div class="h5"><br>
On Fri, Apr 23, 2010 at 7:52 PM, Leonardo Uribe <<a href="mailto:lu4242@gmail.com">lu4242@gmail.com</a>> wrote:<br>
> Hi<br>
><br>
> Looking some jsf 2.0 code, I notice the current algorithm of<br>
> UIData.invokeOnComponent cannot handle the case when the target is a<br>
> UIColumn instance and no rowIndex is on clientId. Is that ok?<br>
><br>
> Checking the new visit tree api, UIData.visitTree cleary says:<br>
><br>
> "....If this component has children, for each UIColumn child:<br>
><br>
> Call VisitContext.invokeVisitCallback(javax.faces.component.UIComponent,<br>
> javax.faces.component.visit.VisitCallback) on that UIColumn instance. If<br>
> such a call returns true, terminate visiting and return true from this<br>
> method.<br>
><br>
> If the child UIColumn has facets, call<br>
> UIComponent.visitTree(javax.faces.component.visit.VisitContext,<br>
> javax.faces.component.visit.VisitCallback) on each one....."<br>
><br>
> I think we should do something like this:<br>
><br>
> for (Iterator<UIComponent> itChildren =<br>
> this.getChildren().iterator();<br>
> !returnValue && itChildren.hasNext();)<br>
> {<br>
> UIComponent child = itChildren.next();<br>
> if (child instanceof UIColumn &&<br>
> clientId.equals(child.getClientId()))<br>
> {<br>
> try {<br>
> callback.invokeContextCallback(context, child);<br>
> } catch (Exception e) {<br>
> throw new FacesException(e);<br>
> }<br>
> returnValue = true;<br>
> }<br>
> // process the child's facets<br>
> for (Iterator<UIComponent> itChildFacets =<br>
> child.getFacets().values().iterator();<br>
> !returnValue && itChildFacets.hasNext();)<br>
> {<br>
> //recursive call to find the component<br>
> returnValue =<br>
> itChildFacets.next().invokeOnComponent(context, clientId, callback);<br>
> }<br>
> }<br>
><br>
> Does that sounds reasonable? Should be fixed on 1.2.x branch too?<br>
><br>
> regards,<br>
><br>
> Leonardo Uribe<br>
><br>
><br>
<br>
<br>
<br>
</div></div>--<br>
<br>
<a href="http://www.irian.at" target="_blank">http://www.irian.at</a><br>
<br>
Your JSF powerhouse -<br>
JSF Consulting, Development and<br>
Courses in English and German<br>
<br>
Professional Support for Apache MyFaces<br>
</blockquote></div><br>