I have problem with dynamic generated ids in f:ajax tag in render parameter. I get error:
Component with id:pak_Internet not found
viewId=/start.xhtml
location=C:\servers\apache-tomcat-7.0.29\temp\tst-web-war\start.xhtml
phaseId=RENDER_RESPONSE(6)
Caused by:
javax.faces.FacesException - Component with id:pak_Internet not found
at org.apache.myfaces.renderkit.html.HtmlAjaxBehaviorRenderer.getComponentId(HtmlAjaxBehaviorRenderer.java:411)
code:
<ui:repeat var="servicesPhones" value="#{cc.attrs.limits.servicesLimits}">
<h:selectOneMenu
value="#{cc.attrs.limits.phoneSelected}">
**<f:ajax render="pak_#{servicesPhones.name}" event="change" execute="@this"/>**
<f:selectItems value="#{cc.attrs.limits.getPhones(servicesPhones.name)}" />
</h:selectOneMenu>
<h:panelGroup id="pak_#{servicesPhones.name}">
<ui:repeat var="pak" value="#{cc.attrs.limits.getPackages(servicesPhones.name)}">
#{pak.name}<br/>
</ui:repeat>
</h:panelGroup>
</ui:repeat>
Any idea how to resolved this?
Just remove those EL expressions from the
idattribtue. The<ui:repeat>will by itself already ensure the uniqueness of those IDs and already update the right one.If you used those EL expressions with the sole reason to be able to identify/select the JSF-generated HTML representation in JavaScript or CSS, then you’d need to look for an alternate approach via
styleClass.