• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

displaytag help, sorting map objects

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I am creating a list of map, in the map i am specifying both column and values dynamically. i could able to display the data using the display tag.but i could not do the sorting on each columns.

I am wondering how to enable Sorting on each column of the map.

note: i could find sortable column only in the <display:column ..> tag,. but i cannot use this in this case because, i don't know how many columns would i display each time.

following is the sample code, i am using.
List listOfSearchValue = new ArrayList();
for(int i=0; i <10; i++)
{
SortedMap sortedMap = new TreeMap();
sortedMap.put("name","name_" + i);
sortedMap.put("address","address_" + i);
sortedMap.put("city","city_" + i);
sortedMap.put("state","state_" + i);
listOfSearchValue.add(sortedMap);
}
request.setAttribute("SearchResult", listOfSearchValue);

<display:table name="SearchResult" id= "result" requestURI="refferencePaResponseListPopulateAction.do" pagesize="15" sort="list" class="displaytablestyles" >
</display:table>

please help me to find a way to sort columns name, address, city and state in the above example.

Thanks
Guna
 
I've got no option but to sell you all for scientific experiments. Or a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic