MyEclipse Forums
This thread has been locked & this forum has been archived.
Please post new topics to Feature Requests
View previous topic Printable version Log in to check your private messages View next topic
Author Message
vrahul14
Post subject: Paging for Spring Scaffolding Code  PostPosted: Nov 19, 2010 - 07:16 PM



Joined: Nov 19, 2010
Posts: 5

I was going through the generated code for Spring Scaffolding for Spring MVC. For the View Page, is it possible to add Simple Pagination possible like "Previous, 1, 2, ... Next".

This will help keep the code consistent across all pages.

Thanks
Rahul
 
 View user's profile Send private message  
Reply with quote Back to top
davemeurer
Post subject: RE: Paging for Spring Scaffolding Code  PostPosted: Nov 19, 2010 - 07:58 PM



Joined: Jan 20, 2010
Posts: 191

Hi Rahul,

Currently, only pagination is available in the GWT Front End option. Pagination can be a tricky technique and there are many different approaches. We do have this feature request documented, so I'll escalate it based on your comments.

If we were to add this pagination, how would you see it being implemented? In Spring MVC, would you want all the records to be delivered to the client, and have javascript page through the results. OR, would you prefer AJAX type calls and only have the section of rows be sent back based on the current page causing a hit to the server. Any thoughts would help out tremendously.

Kind regards,
Dave
 
 View user's profile Send private message  
Reply with quote Back to top
vrahul14
Post subject: RE: Paging for Spring Scaffolding Code  PostPosted: Nov 19, 2010 - 11:33 PM



Joined: Nov 19, 2010
Posts: 5

Hi,

Thanks again for your fast responses.

Sending all the data from database table and having Javascript to page the data won't be good since that will make the application very slower over sometime as the database get's bigger, sending all the unwanted data back to browser. I think Spring provides org.springframework.beans.support.PagedListHolder class for this. Definitely would not prefer this approach.

--------

To start with, it could be a simple navigation which can take page number as request param, and send request back to server and refresh the entire page. On the UI side, there could be simple Pager JSP Tag which can take following attributes (Current Page Number, Total Record Count, Items per Page) and based on this generate page links like (Previous, 1, 2, ... Next). The server can set these attributes for JSP Tag as Request Attributes.

Also when doing this, it will be helpful to keep the application state as Stateless, and execute some of queries like "Get Record Count..." again for each request, since there will be multiple people working on the app, and the page count keeps changing.

We can rely on Hibernate Cache to cache this info if required, or if some one wants to cache the Record Count info, it can be done in Session Cache using Input app Keys etc. This could be left to application specific usage. This would be better instead of making the entire Bean as Stateful object.

--------


Ajax based Pagination would be ideal, but for the Spring MVC App code generated this will introduce new Javascript code which some new people may take time to get to. And also be able to deal with security config if introducing JSON based data transfer.

The way it was done in other apps i saw was, during the code generation, the user was prompted if Ajax needs to be enabled in the code generated. But then i think this may make the code generation bit complex with all the switches.

Thanks
Rahul
 
 View user's profile Send private message  
Reply with quote Back to top
davemeurer
Post subject: RE: Paging for Spring Scaffolding Code  PostPosted: Nov 22, 2010 - 02:37 PM



Joined: Jan 20, 2010
Posts: 191

Thank you Rahul. That is great information, and I'll be sure to raise this up to our product team.

Kind regards,
Dave
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits