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

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) ? "<tr class='table_banded_row' valign='top'>" : "<tr class='table_row' valign='top'>");
tableBody = tableBody + "<td class='table_data'>" +
procHelper.getCompVersionLink(versionId, 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 page
public String getCompVersionLink(long versionId, String compName, String compVersion){
return "<a class='datalink' title='" + this.getComponentFlyOverText(versionId) + "' href='/techstacks-v2_1/content/components/componentDetail.jsp?versionId=" + versionId + "'>" + compName + "  " + 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

Sorting and paging - two separate issues. Tackle them separately.
Sounds like you've given yourself a problem by embedding all this logic in the JSP itself. That makes a mess. If you had a front controller servlet that could help you out that would make the page easier.
I think your difficulties are caused by a bad design.
Do your sorting by putting data structures into request scope on the page and make the sort requests back to the page itself. Rearrange the data, then display.
The paging issue is separate. Set the fetch size and have a server-side component that helps with the paging.
%

Similar Messages

  • Want to sort tables inside a complex mechanism, what can be the approac

    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) ? "<tr class='table_banded_row' valign='top'>" : "<tr class='table_row' valign='top'>");
    tableBody = tableBody + "<td class='table_data'>" +
    procHelper.getCompVersionLink(versionId, 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 page
    public String getCompVersionLink(long versionId, String compName, String compVersion){
    return "<a class='datalink' title='" + this.getComponentFlyOverText(versionId) + "' href='/techstacks-v2_1/content/components/componentDetail.jsp?versionId=" + versionId + "'>" + compName + "  " + 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

    Sorting and paging - two separate issues. Tackle them separately.
    Sounds like you've given yourself a problem by embedding all this logic in the JSP itself. That makes a mess. If you had a front controller servlet that could help you out that would make the page easier.
    I think your difficulties are caused by a bad design.
    Do your sorting by putting data structures into request scope on the page and make the sort requests back to the page itself. Rearrange the data, then display.
    The paging issue is separate. Set the fetch size and have a server-side component that helps with the paging.
    %

  • I want to repurchase the widescreen version of the wizard of oz, itunes won't let me repuchase it, and wants to download my old non widescreen version, what can I do ?

    i want to repurchase the widescreen version of the wizard of oz, itunes won't let me repurchase it, and wants to download my old non widescreen version, what can I do ? I would like to have the wide screen version, how do I accomplish this?

    Hello,
    Please see What userid & password do I need to install Flash Player?.
    Maria

  • HT201303 my computer was hacked and also he hacked my apple acount and he tried to use and i think he did. i dont want to use my mastercard any more! what can i do while apple app store force me to it?

    my computer was hacked and also he hacked my apple acount and he tried to use and i think he did. i dont want to use my mastercard any more! what can i do while apple app store force me to it?

    Have you tried here:
    iOS: Not responding or does not turn on
    You can check your warranty coverage by entering the SN here:
    Apple - Support - Check Your Service and Support Coverage
    For how to get warranty work see:
    Apple - Support - iPod - Service FAQ
    The fastest is to make an appointment at the Genius Bar of an Apple store.

  • HT1937 if you are to update your iphone and after it says the simcard inside is not supported, what can yo do?

    if you are to update your iphone and after it says the simcard inside is not supported, what can yo do?

    That means your phone was hacked to unlock it.
    ONLY the carrier it is locked to can authorize unlocking it.
    It may no longer be possible to process a legitimate unlock on a phone that was hacked/jailbroken. The hack can do permanent damage.
    You can find out who it was locked to and find out if they offer unlocking and if you qualify.
    Don't be surprised if you are never able to use it again. It may be permanently bricked.

  • Want to upgrade from iMovie to FCE. What will be the difference?

    I am currently working through hours of DV footage from my camcorder using my Macbook and iMovie. Although I have been pleased with the results I know now that I want to upgrade to both a better computer and to Final Cut Express. I have also been considering going the full way to Final Cut 2 but as this is a lot more money I am wondering whether the upgrade to FCE will be enough. What extra do you get with FCE over iMovie and what more will it allow me to do. I have been pretty amazed at how good iMovie is at a consumer level so would expect FCE to allow me to be even more creative but am not sure exactly how. Is the upgrade enough or would FC2 be a better option. I will not be needing to make broadcast or professional productions, just do a good job at a serious amateur level. I do not need to use a lot of effects but I do want to be able to add good soundtracks and transitions. The audio is an important part of my movies.
    thanks

    Brilliant..just what I wanted. Thanks. Looks like I will need to read up on some of the terminology to get a good idea of what each feature before buying but thats a great table.

  • HT1459 HI! I WANT IOS 7 ON MY IPOD TOUCH 4G WHAT CAN I DO?

    hi i want ios 7 in ipod 4 what can i do

    There is othing you can do, iOS 7 requires an iPod Touch 5 th generation or above.

  • I can't backup my iPhone 5. It says I don't have enough storage. So I've deleted like 6-7 apps and its still says I don't have enough storage. And it also says the say thing when I want to buy new apps or music. What can I do?

    I can't backup my iPhone 5. It says I don't have enough storage. So I've deleted like 6-7 apps and its still says I don't have enough storage. And it also says the same thing when I want to buy new apps or music. Also my messages won't send; I have to turn my phone off and resend then just to they can send. I can't even take any pictures because it says I have no storage.(I currently have 1,658 photos and 72 videos by the way.) What can I do? I just my phone in late December. I didn't think it would act up this bad before I even had it for a year. Please help.

    Your phone needs more storage, buying storage on iCloud.com doesn't change that.
    Delete some of the stuff off of your phone, it's full.

  • I don't want my iPod Shuffle to shuffle... what can I do?

    I want to use my Shuffle for a special event and hook it into the sound system of a church and play the songs in the order I want to play them. I made a playlist in iTunes in the order I wanted and then pulled that onto the Shuffle, but they don't play in order when I just put the Shuffle on Play in Order position, but doesn't work. What can i do? I need to know today for tomorrow's event. THANKS!
    iPod Shuffle 512MB    

    I guess I figured it out... I put each song in individually, in REVERSE order of how I wanted to play them. THEN when I play them, they are in the correct order.... Weird but true!

  • HT204364 I want an empty page inside my card. How can I order that?

    I would like to keep the inside of my iphoto card blank. How can I over-ride your system to do that?
    Thanks, Jan

    Just select an all text inside layout:
    and put a single space in each of the text boxes to get this:
    OT

  • Sort Key .... where we can see the activity in GL, Vendor, Customer mater

    Hi gurus,
    what is the use Sort key,
    where we can see that activity.  in GL Accounts, Vendor, customer master sort key where we can see effects. what is the use, how it will sort, where i can see.
    Thanks  for your reply.
    Anil

    Dear Anil,
    Sort key is the one that fills the "Assignment field" of a line item automatically.
    For example, for the GR / IR accounts, we normally give the "Purchase Order" as the sort key. This will make the line items in the GR/IR account to be filled with the Purchase order and the Item number.
    The automatic clearing (F.13) works with the assignment field. In case the net of two line items (Dr - Cr) is equal to zero and the assignment field of these two lines are the same, then the system will automatically clear these two lines. Hence "Sort key " fills the assignment field and is very useful in automatic clearing
    regards
    Venkatesh
    Assign points if useful

  • Can I hook up an ipod touch to a tv so I can use facetime across the globe.  I live in Oz my brother lives in UK and I want to buy him an ipod touch so we can have the great facetime chats but I want to do it on the bigscreen.  Is this possible?

    I think the title says it all really.  I am looking to buy my brother in the UK an ipod touch so we can have a good chat via facetime as I find it better than Skype BUT I want to have the conversation on the tv rather than all the family trying to cram around an ipod touch or the ipad.  Is there a way of hooking the devices up to the tv so we can acheive this?  It would be great if we could.  I know you can hook up an ipod to the tv to watch films etc if it jailbroken so the technology is there but do Apple utilise it all the way?  If not why not?  I dont want this to turn into a platform for politics please, just after a little help.

    Google shows it will works with a 5G iPod touch and with a Apple TV 2. You would use AirPlay mirroring.

  • Want to create a link on seeded page which can pass the values of LOVs

    Hi,
    I have a seeded page.. and i want to create a Link on the page which will redirect to new custom page...
    When user clicks on the link, the values of some LOVs should be forwarded on the custom page......
    I created a link through personalization... But I have doubt about how to attach the values of LOVs through url....
    Is it possible to do the same???
    Thanks in advance,
    Kaushik

    Thanks Pratap,
    Yes the LOVs are created through personalization....
    Since i dint want to touch the code... so i created everything through personalization.....
    The only problem now is to get the values of these LOVs in URL....
    Is there no other method other then extension to do this???
    Thanks,
    Kaushik

  • Firefix sad:"Copy/Cut/Paste is not available in Mozilla and Firefox. Do you want more information about this issue?" But,I can do the that from Opera...What should I do?

    Copy/Cut/Paste is not available in Mozilla and Firefox.
    Do you want more information about this issue?
    That's what Firefox sad to me...I was Rich text editing,but I can
    not use copy paste on.
    I did the same site and Rich text editing with Opera,
    and there was no problem.
    I love Firefox,and I want ti use it,but if this is not posibile to do in Firefox,I must go with Opera from now on.
    Pleace,responde to me,I need to fix a problem.
    I hope you understanded my Engish!
    Thank you...

    Try to use the keyboard if the buttons on the web page aren't working.
    * Copy: Ctrl+C or Ctrl+Insert
    * Paste: Ctrl+V or Shift+Insert
    * Cut: Ctrl+X or Shift+Delete
    See:
    *http://kb.mozillazine.org/Granting_JavaScript_access_to_the_clipboard
    *https://addons.mozilla.org/firefox/addon/allowclipboard-helper/

  • I inadvertently imported all of my iPhoto videos to my iMovie library.  I have tried everything possible to delete them.  I still want to keep them in iPhoto however. What can I do?

    I inadvertently imported all of my iPhoto videos to my iMovie library.  I have been unable to delete them. How can I delete them from the iMovie library without deleting them fro iPhoto?

    Did you import them into an Event Folder? Or are they still just showin up under the iPhoto Videos folder? Anything inside of the iPhoto Videos folder cannot be deleted, because it is under the full control and jurisdiction of iPhoto and is merely 'shared' from iPhoto and made visible to iMovie. Everything else can first be deleted, then moved to the Trash. To find the items that have been marked for deletion under iMovie '11 go to the pull-down tab at the bottom of the iMovie window frame labeled Show: and choose 'Rejected Only'. Then when you see all the clips with red stripes on them Select All (⌘ Command key + a). Then click on the button labeled Move rejected to Trash.

Maybe you are looking for

  • IMovie Text Button!!!!

    Ah! I am working on a Spanish Video Project and the iMovie text button on the right hand side doesn't seem to be working. It always crashes the system. But, thankfully my work has always been saved. Please help me on this. My project needs text throu

  • Error in releasing billing to accounting

    Dear Friends, I am facing an error while releasing the billing document to accounting.....error is "only output tax is allowed for acount 175000 9999, 01 is not allowed"......what wud b the reason?.....thanks in advance....

  • Ipod NOT restoring properly or being recognized in itunes!!!

    so yesterday i was trying to (manually)update my ipod and then it somehow got messed up so i decided to just restore it. but when i went to restore it, after it 'restored' it normally says on the ipod to plug it into a wall outlet for the frim wire s

  • Negative number in delete file window

    If you have a folder with lots of files and more hidden files (filename starting with a dot), then the delete files window computes the number of elements to delete based only on the visible files, but then the "elements to delete" counter takes into

  • Since last update, i can't send emails!

    since I updated my iphone 4 last week, i can't send email with only one special email-adress. My provider says, this a problem to apple and the update...can anybody help?