How do I do something like this
Inside JSF file, list.xhtml
<p:dataTable value="#{document.drawings}" var="item">
//document is the backing bean that has method getDrawings() that return list of item
</p:dataTable>
Inside my backing bean, document.java
List<Drawing> drawings;
...
public void List<SelectItem> getDrawings(){
if(application first load){
return sessionBean.getAllDrawings();
}else{
return drawings;
}
}
So the logic is that if the application first load, then load every thing from the datasource, by accessing method getAllDrawings()
inside session bean
, otherwise return drawings
which is the list of Drawing that has been manipulate by some ajax method.