i you send the source of my controller
ackage maurocontrollers;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.enterprise.context.SessionScoped;
import javax.inject.Inject;
import javax.inject.Named;
import mieientity.ConsultDTO;
/**
*
* @author utente_javaee7
*/
@Named(value = "mauroController")
@SessionScoped
public class MauroController implements Serializable {
private ConsultDTO current;
private List<ConsultDTO> list=new ArrayList<ConsultDTO>();
/**
* Creates a new instance of MauroController
*/
public MauroController() {
}
@PostConstruct
public void init(){
if (current==null){
current = new ConsultDTO();
}
ConsultDTO c1, c2 ,c3 ,c4;
c1= new ConsultDTO("a");
c2= new ConsultDTO("b");
c3= new ConsultDTO("c");
c4= new ConsultDTO("d");
c1.setDescription("first description");
c2.setDescription("second description");
c3.setDescription("terza descrione");
c4.setDescription("4 descrizione");
this.list.add(c1);
this.list.add(c2);
this.list.add(c3);
this.list.add(c4);
}
public String creaNuovo(){
this.list.add(current) ;
this.list.size();
return"List";
}
public List<ConsultDTO> getElenco(){
return this.list;
}
public String cancellaCurrent(){
this.list.remove(current);
this.current= new ConsultDTO();
return "List";
}
public List<ConsultDTO> getList() {
return list;
}
public void setList(List<ConsultDTO> list) {
this.list = list;
}
public String getId() {
return current.getStatusId();
}
public void setId(String id) {
this.current.setStatusId(id);
}
public String getDescription() {
return current.getDescription();
}
public void setDescription(String description) {
this.current.setDescription(description);
}
public ConsultDTO getCurrent() {
return current;
}
public void setCurrent(ConsultDTO current) {
this.current = current;
}
}
--
View this message in context:
http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717p4667730.html
Sent from the OpenEJB User mailing list archive at Nabble.com.