want to sort columns in jsp but inside a complex mechanism, please suggest some good apporach?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Vijendra_Singh
Posted On:   Thursday, December 28, 2006 08:32 AM

I have a situation where first we are fecthing some ids(list of say version ids using hibernate form database) then keeping those list of data in a Pager Object(Paging mechanism displays 100 rows per page out of complete sa 100 or so.) This pager class does two things one takes whole list of ids (Collection of version_id). (Every time based on search criteria it changes. For searching in hibernate values are hardcoded. Want modification with minimal changes as many things are interrelated here.) and other thing it checks no. of contents based on that displays data per page(100 here). It means stores all data from database and send it oage by page.(First thing to notice) Next all this is getting stored in Report p   More>>

I have a situation where first we are fecthing some ids(list of say version ids using hibernate form database)
then keeping those list of data in a Pager Object(Paging mechanism displays 100 rows per page out of complete sa 100 or so.)
This pager class does two things one takes whole list of ids (Collection of version_id).
(Every time based on search criteria it changes. For searching in hibernate values are hardcoded. Want modification with minimal changes as many things are interrelated here.)
and other thing it checks no. of contents based on that displays data per page(100 here).
It means stores all data from database and send it oage by page.(First thing to notice)

Next all this is getting stored in Report page where it searches other column names based on ids(version_id) the other column names are getting changed for different requests so what we do is take all other columns collectAllExtraFields(this is also getting changed everytime based on what is getting searched.)
Now all this is getting accumulated while displaying but as we know what to display we hardcoded all fields required to display based on search. But all fields are searched based on the id fetched from database first time which Pages is storing.
like this

Search for product user information & retrun results in the form of a paged table for components used by specific product

ComponentVersion versionObj = versionHandler.getComponentVersion(versionId);
String CAUsers = ctHelp.getCAUsersSection(versionId);
tableBody = tableBody + ((i%2 == 0) ? " " : " ");
tableBody = tableBody + " " +
procHelper.getCompVersionLink(versionId, versionObj.getCompName(), versionObj.getCompVersion()) + " ";
tableBody = tableBody + " " +
CAUsers + " ";
tableBody = tableBody + " " +
versionObj.getComponent().getType() + "
";
tableBody = tableBody + " " +
versionObj.getComponent().getVendor() + "
";
tableBody = tableBody + " " +
versionObj.getRecommendationType() + "
";
tableBody = tableBody + " ";

/** Get ComponentVersion ID with hyperlink to ComponentVersion Detail page
*/
public String getCompVersionLink(long versionId, String compName, String compVersion){
return " " + compName + "  " + compVersion + " ";
}


this is getting called by Report.jsp to display.
As this is getting changed everytime its called form classes not used in jsp directly i think.

Now original objective is to sort all these displayed columns.
If user clicks on any of the column name everything sholud get sorted on that basis.but sholud not call databse for same again by using same id and mapping with any new column name this sholud be done. Paging mechinasm to be used as it is if possible without major changes.

i don't know where to start with as started looking on this code just 2-3 days back only.

Vj

   <<Less
About | Sitemap | Contact