1

My setup is the following: I have a composite component (taskEntry) inside another (taskList).

<ul class="tableView">
                    <ui:repeat value="#{cc.attrs.taskList}" var="task"> 
                            <jid1:taskEntry task="#{task}" />
                    </ui:repeat>
</ul>

The task entry is defined as:

<li>
                <h:outputText value="#{cc.attrs.task.title} " />
<h:commandLink actionListener="#{cc.attrs.taskBean.toggle(cc.attrs.task)}">
                            <f:ajax execute="@this" render="??" />
                        </h:commandLink>
</li>

Can you suggest which Id I should render?

If I define an 'id' inside the 'li' (eg. a panelGroup), first ajax call works as expected, second call does nothing, third one gives me an JS error. Adding a panelgrid to surround the 'li' does not render the panelgrid definition at all. I do not want to re-render the whole list, just the jid1:taskEntry

The error I get at the 3rd click is:

java.lang.IllegalStateException: Component ID j_idt37:j_idt52:j_idt55:j_idt61 has already been found in the view.
Ioannis Deligiannis
  • 2,679
  • 5
  • 25
  • 48
  • I am not sure about the details but here is what happens: The ajax call cannot render just the panelGroup inside the nested component. It has to recreate both composite components so the id's get created again and for some reason added to components naming container. Solution is to re-render the parent component by passing it's id. – Ioannis Deligiannis Mar 09 '13 at 14:19
  • As per this link, composite component gets rendered as a single component. So making an ajax-enabled compoenent doesn't make too much sense. Use tag instead: http://stackoverflow.com/questions/5713718/how-to-make-a-grid-of-jsf-composite-component – Ioannis Deligiannis Mar 09 '13 at 15:22
  • I changed the implementation and used custom tags instead. It appears that f:ajax inside ui:repeat cannot render components that are located within the ui:repeat. The following tag will not work ` ` – Ioannis Deligiannis Mar 09 '13 at 19:45
  • This is a duplicate of: http://stackoverflow.com/questions/11364006/how-to-partially-reload-a-uirepeat – Ioannis Deligiannis Mar 16 '13 at 20:55

0 Answers0