want to sort tables inside a complex mechanism, what can be the approach?

Discussion in 'Java' started by vj, Dec 28, 2006.

  1. vj

    vj Guest

    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 =
    String CAUsers = ctHelp.getCAUsersSection(versionId);
    tableBody = tableBody + ((i%2 == 0) ? "<tr
    class='table_banded_row' valign='top'>" : "<tr class='table_row'
    tableBody = tableBody + "<td class='table_data'>" +
    versionObj.getCompName(), versionObj.getCompVersion()) + "</td>";
    tableBody = tableBody + "<td class='table_data'>" +
    CAUsers + "</td>";
    tableBody = tableBody + "<td class='table_data'><span
    class='data'>" +
    versionObj.getComponent().getType() + "</span></td>";
    tableBody = tableBody + "<td class='table_data'><span
    class='data'>" +
    versionObj.getComponent().getVendor() + "</span></td>";
    tableBody = tableBody + "<td class='table_data'><span
    class='data'>" +
    versionObj.getRecommendationType() + "</span></td>";
    tableBody = tableBody + "</tr>";

    /** Get ComponentVersion ID with hyperlink to ComponentVersion Detail
    public String getCompVersionLink(long versionId, String compName,
    String compVersion){
    return "<a class='datalink' title='" +
    this.getComponentFlyOverText(versionId) + "'
    + versionId + "'>" + compName + "&nbsp;&nbsp;" + compVersion + "</a>";

    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, Dec 28, 2006
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ken
  2. Andrey Brozhko
    Andrey Brozhko
    Dec 21, 2004
  3. Angus Comber
    Richard Heathfield
    Feb 5, 2004
  4. Replies:
    Pavel Lepin
    Sep 13, 2007
  5. Navin
    Ken Schaefer
    Sep 9, 2003

Share This Page