Announcement Announcement Module
Collapse
No announcement yet.
Move the Record - MoveFirst, MoveLast, MoveNext, MovePreviou Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Move the Record - MoveFirst, MoveLast, MoveNext, MovePreviou

    Hello Everyone,

    I am having 10 records in a table.
    I want to get the record, when I click the buttons like MoveFirst, MoveLast, MoveNext and MovePrevious.

    How can I do this using Spring Framework?

    I am trying to do this without adding the scriptlets to the resultant JSP.

    Thanks in advance.

    -S.Yogesh

  • #2
    Hi syogesh,

    What exactly are you trying to do? Do you want to navigate those records by hitting next and previous buttons or do you want to change the position of each record within the table?


    Cheers,

    Martin

    Comment


    • #3
      If you want pagination you can find some examples and discussions on this topic in the Hibernate wiki: http://www.hibernate.org/243.html

      Comment


      • #4
        Hi Martin,

        I am trying to navigate the records by hitting the "Move Next", "Move Previous", "Move First" and "Move Last" buttons.

        Then, the data will be displayed in the Text Box, corresponding to the button I hit.

        Thanks for your reply.

        Regards,
        -S.Yogesh

        Comment


        • #5
          I am trying to navigate the records by hitting the "Move Next", "Move Previous", "Move First" and "Move Last" buttons.

          Then, the data will be displayed in the Text Box, corresponding to the button I hit.
          So to paint a picture about it, you have a single page view and all your records in your tables represent pages in a book. When you hit the next page button you want to show the next page etc.

          That makes sense to me. I think, a good way to implement this might be looking into Spring's WebFlow sub-project. http://opensource.atlassian.com/conf...y/WEBFLOW/Home

          But in the end, all you need is maintaining the number of the next and previous 'page/record' to show when the button is pressed (dynamic link might do it: showPage.html?page=${currentPage + 1}).

          And also you need an ordering for the records. Normally a database relation is a union and not a list. One idea might be using 'oder by' in either SQL or Hibernate to achieve it.

          Since you are likely to fetch just a single row (or object), using pagination or a little session scoped cache might do the trick.


          Cheers,

          Martin (Kersten)

          Comment

          Working...
          X