I am using spring mvc 3.0 and display tag. so, using display I get datas like 1,2,3,4. Now the latest record appears in page 4. Now I want the latest data to be displayed on page 1, how can I do this???
3 Answers
Are you trying to achieve pagination? If so what kind of records are you bringing? For example if you are bringing list of names for which you have an id you can either sort the id ascending or descending based on your requirement and bring to the front end and display accordingly. As per your question you seem to be bringing the latest records in the 4th page. It's purely based on your requirement whether to bring in which order. Please give more details to address the problem in a better way.

- 1,866
- 13
- 15
-
my requirement is to bring the latest records in 1st Page. for eg: contents of page 1:order id=1,2,3,4 , contents of page 2: order id=5,6,7,8 now, I want the the latest record to be availble in page 1 i.e. id=5,6,7,8 – curiouss Apr 30 '12 at 07:04
If the data u want to display is just numbers then sort the list u are displaying in descending order as per the order of entry and I believe that it is true for the list so u will get the last element at the bottom of the list. now what u need to dois invert the order of this list and make use of this temporary inverted list in displaying on the UI.

- 86
- 4
you can use attribue defaultorder of
eg
<display:table uid="1" name="locationList" class="displaytag" id="location" pagesize="10" excludedParams="*" requestURIcontext="true" defaultorder="ascending" requestURI="action_name.do" export="true" >

- 2,597
- 6
- 27
- 35