I’m trying to update an element within an UI-repeat, but unfortunately I still haven’t discovered how to correctly address the outputPanel from within the dataTable. I am aware that this problem comes from the different naming containers, nevertheless, I hope there will be a solution.
<h:body>
<h:form id="form">
<ui:repeat var="_entry" value="#{test.entries}">
<p:outputPanel id="counterPanel">
<h:outputText value="#{test.counter}" />
</p:outputPanel>
<p:dataTable var="_p" id="paramTable" value="#{_entry.params}">
<p:column headerText="Options">
<p:commandLink value="Update" update="counterPanel" />
</p:column>
</p:dataTable>
</ui:repeat>
</h:form>
</h:body>
The code example above raises the following exception:
javax.servlet.ServletException: Cannot find component with identifier "counterPanel" in view.
Thx,
Jakob
Two ways:
You need to give the
<ui:repeat>a client ID so that you can refer it by the absolute client ID path:Move the
<h:form>to inside the outer loop so that you can use@form: