Hi,
I'm trying to upgrade from MyFaces 1.2.7 to 2.0.4 our online store. To
do it, I need to adapt our own UICommand components to the new version.
I'm working on overwrite your HTMLLinkRendererBase in order to adapt it
to our graphic requirements, but keeping original javascript generation.
Now I think I have found a bug if there is a commandLink or
commandButton with ajax behavior, inside a ui:repeat tag. For example:
<h:outputText id="texto" value="#{bean.texto}">
</h:outputText>
<br/><br/>
<ui:repeat value="#{bean.textos}" var="text">
<h:commandLink id="boton10" value="#{text}">
<f:ajax event="click" render="texto"
listener="#{bean.actionListenerLink}"/>
</h:commandLink>
<br/>
</ui:repeat>
If there is no ajax modifier, all works fine, but if there's they trhow
a:
javax.faces.FacesException: Component with id:texto not found
org.apache.myfaces.renderkit.html.HtmlAjaxBehaviorRenderer.getComponentI
d(HtmlAjaxBehaviorRenderer.java:289)
I have solved it rewriting the findComponent(String id) method in our
implementation, in order to search for the 'render' id (texto in the
example) starting from the viewRoot.
I think the problem is that in the UIComponentBase.findComponent(String
id) it looks for the referenced component, starting from the closest
NamingContainer to the source element:
if (this instanceof NamingContainer)
{
findBase = this;
}
else
{
findBase = _ComponentUtils.findParentNamingContainer(this, true /* root
if not found */);
}
And, I'm not sure, but I think ui:repeat related component should
implements NamingContainer, so it looks for the referenced component
only inside the ui.repeat tag. Could it be? And could it be solved?
Thanks in advance!
Ricard
Para el
medioambiente cada gesto cuenta: por favor, no imprimas este e-mail si no es
realmente necesario
Este correo y sus
archivos asociados son privados y confidenciales y va dirigido exclusivamente a
su destinatario. Si
recibe este correo
sin ser el destinatario del mismo, le rogamos proceda a su eliminacion y lo
ponga en conocimiento
del emisor. La
difusion por cualquier medio del contenido de este correo podrĂa ser sancionada
conforme a lo previsto
en las leyes
espanyolas. No se autoriza la utilizacion con fines comerciales o para su
incorporacion a ficheros
automatizados de
las direcciones del emisor o del destinatario.
Each one of us can
do our bit for the environment: please, do not print this e-mail unless it is
absolutely essential.
This mail and its
attached files are confidential and are exclusively intented to their
addresses. In case you may
receive this mail
not being its address, we beg you to let us know the error by reply and to
proceed to delete it. The
circulation by any
mean of this mail could be penalised in accordance with the Spanish
legislation. The use of both
the transmitter
and the addresses with a commercial aim, or in order to be incorporated to
automated files,
is not authorized.