Please see the image below.
Those images show how things work with my current code. When I delete the last panel and push the update button, all the panels disappear somehow. It works well when I do the same with the rest of the panels.
If anyone knows how to solve this problems, it would be a great help. Thanks in advance.
I've attatched the code below (just in case):
【xhtml】
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui" xmlns:ui="http://java.sun.com/jsf/facelets"> <h:head></h:head> <h:body> <h:form> <ui:repeat value="#{newapp001.list}" var="item" > <p:panel header="#{item}" closable="true" > <p>my information</p> </p:panel> </ui:repeat> <p:commandButton value="Update" update="@form" /> </h:form> </h:body> </html>
【ManagedBean】 package sample;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.enterprise.context.SessionScoped;
import javax.inject.Named;
@Named("newapp001")
@SessionScoped
public class NewApp001 implements Serializable
{
private static final long serialVersionUID = 2610647621325923945L;
private List<String> list;
public NewApp001()
{
this.list = new ArrayList<>();
this.list.add("aaa");
this.list.add("bbb");
this.list.add("ccc");
this.list.add("ddd");
return;
}
public List<String> getList()
{
return this.list;
}
}