myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Broadhead <>
Subject ui repeat fails to reflect collection after render
Date Thu, 25 Jan 2018 15:14:45 GMT
i just posted this question on stack overflow.  but then i tested 
switching to mojarra and that solved my problem so i guessed i would 
report it to this list

Consider the following xhtml fragment:

<h:outputText value="#{myBean.items.size()}" />
<ui:repeat var="item" value="#{myBean.items}">
         <h:outputText value="#{} #{}" />
         <h:commandButton value="delete" action="#{myBean.delete}">
             <f:setPropertyActionListener target="#{myBean.item}" 
value="#{item}" />
             <f:ajax render="@form" />
<c:forEach var="item" items="#{myBean.items}">
         <h:outputText value="#{} #{}" />
With the backing bean delete method:

public String delete() {
     return null;
And the itemDao methods like:

public List<Item> select() {
     CriteriaBuilder cb = em.getCriteriaBuilder();
     CriteriaQuery<Item> cq = cb.createQuery(Item.class);
     Root<Item> item = cq.from(Item.class);
     TypedQuery<Item> query = em.createQuery(cq);
     List<Item> itemList = query.getResultList();
     return itemList;
public void delete(Project project) {
     project = find(project.getProjectId());
The problem is that after the delete button is clicked the count is 
correct, the c:forEach is correct, but the ui:repeat is not updated and 
still shows the deleted element. Can someone suggest how to force the 
ui:repeat to also refresh?

View raw message