Posts

Showing posts with the label ejb

Sorting and Paging with EJB Alternatives

Sorting and Paging with EJB Alternatives A rather clean approach would have been EJB returns a List, Bind the List to Table Component . Thats-it every thing has to work. There are two intresting problems to solve 1) Sorting :- The Table component does its own sorting. It does not use database sorting capabilities nor ejb facilities. Solution is writing TableSorter and bind it to the TableComponent. 2) Paging :- The dataprovider performs the job of paging.  Dataprovider interface provides getRowCount () , getRowKeys (int count, RowKey afterRow) . The strait forward approach will be overwrite these methods in the custom dataprovider. But intrestingly the TableComponent has a bug. It always call this method with afterRow=null. As a result we cannot use inbuilt paging features of the Table Component.  Final solution is to write addtional methods in dataprovier to handle paging and call these methods from buttons/links on the webpage.   Other options Using Sta...