Hello Zufolo,
Here is a sample of how I have managed to do it:
public void someMethod() {
// 1. get the managed bean of the page to call next
FacesContext context = FacesContext.getCurrentInstance();
VariableResolver vr = context.getApplication().getVariableResolver();
NewOrderBean nob = (NewOrderBean) vr.resolveVariable(context, "NewOrderBean");
// 2. call JDBC delegate passing sql request
list = OracleDbServicer.jdbcNativeQueryCall(QueryConstants.fetchApproverList(order.getOrderNumber()));
iter = list.iterator();
// 3. get data from arraylist of hashMaps
while(iter.hasNext()) {
HashMap row = (HashMap) iter.next();
SelectItem item = new SelectItem((String) row.get("AC_PK"),
(String) row.get("AC_NAME"),
(String) row.get("AC_NAME"));
nob.getApprovalChainList().add(item);
}
}
The above method is invoked from an eventHandler instance referenced by the backingBean. It delegates processing a request for database info to a backend class that will return an ArrayList of HashMaps (where each row found represents one element in the arrayList returned). The NewOrderBean is the actual backing bean used by the next page to be called. The "nob" instance contains an ArrayList variable
that is populated here with SelectItems.
Hopefully this will help.