Hi all,
I have a JSTL Result which correctly connects to the database and displays the listing of employees for a session variable.
Hurray! <g>
Ok, now I need to implement sorting on the columns of the data table -- so when the user clicks a column the data table sorts by that column -- and be able to programmatically manipulate the data grid to update the database after the user interacts with it.
Here's what I'm thinking based on my
JSF abilites thus far...
========================
Column Sorting...
========================
1. For each header of the data table... could put a command link control as the header like this...
(pseudo code)
<header for employee name...>
<h:commandLink action = "#{originalManagedBean.sortByName}">
</header>
Then, when the user clicks the header, it would kick off the method "sortByName()" in the bean that manages this JSF page. The bean would maintain a local variable to keep track of what the current sort was (asc or desc).
Would this be the best way to implement sorting for a data table against a database?
========================
Data Table Manipulation
========================
2. How to best manipulate the data table after the user has interacted with it (checked column check boxes for example) and I need to save those changes back to the database amd further manipulate the data.
Would I put some type of action on the individual column checkboxes so they update the JSTL Result or would handling the data table as a whole be done on Submit.
I'm really not clear on how I manipulate the JSTL Result object with my traditional "JSP-POST(Back)" way of thinking.
A key question I am running into is ... How do I get at the data table object and manipulate the results so I can do whatever I need to do with the JSTL Result's current dataset?
===========================
Thank you very much for any and all replies!!!
-- Mike