Netbeans/Creator
OS Independant - Java Framework - JSF/JSP
My problem is that I am trying to handle JSF tables with the following functionality:
1. Sortable Column Headers
2. Paging
3. Clicking on a record to navigate to another page (detail page) and then return to the same position in the table when saving or cancelling out of that page.
I've tried using standard JSF components and found no paging support. I then switched to MyFaces and found it clumsy and poorly documented. I finally switched to the Sun JSF components available in NetBeans Visual WebPack. It handles paging very nicely, but doesn't work for sorting. I also haven't figured out how to leave my list to go to a detail and get back to the same place.
The code below accomplishes paging, but I have not figured out sorting or leaving and returning to the same place. I don't want to tie the table directly to a DB table, but rather to a list of objects. I've included relevant code:
//init() method of the JSF Page
List<User> list = getOYSessionBean().getUser
List();
if(list == null || list.size()<=0){
FacesContext context = FacesContext.getCurrentIns
tance();
HttpSession session = (HttpSession) context.getExternalContext
().getSess
ion(false)
;
UserBean loginuser = (UserBean)session.getAttri
bute("Logi
nUserBean"
);
if(loginuser!=null){
User_Manager um = new User_Manager();
um.setPubServerConnection(
loginuser.
getPubServ
erConnecti
on());
um.setServerConfig(loginus
er.getServ
erUtility(
));
if(um.readDBUsers(loginuse
r)==0) list = um.getUserList();
getOYSessionBean().setUser
List(list)
;
}
}
getDpUserList().setList(li
st);
JSF Components used:
import com.sun.webui.jsf.componen
t.Table;
import com.sun.webui.jsf.componen
t.TableCol
umn;
import com.sun.webui.jsf.componen
t.TableRow
Group;
import com.sun.data.provider.impl
.ObjectLis
tDataProvi
der;
Any support would be greatly appreciated. I've been reading tutorial after tutorial on the net, but have found minimal support for interacting with these components using Lists.
Thanks