[displaytag - Open Discussion] using list of map, sorting map help

View: New views
2 Messages — Rating Filter:   Alert me  

[displaytag - Open Discussion] using list of map, sorting map help

by SourceForge.net :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=5115848
By: vgunaselan

Hi All,
I am creating a list of map, in the map i am specifying both column and value
dynamically. i could able to display using the display tag.

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);
}


<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

______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=249317

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
displaytag-user mailing list
displaytag-user@...
https://lists.sourceforge.net/lists/listinfo/displaytag-user

[displaytag - Open Discussion] RE: using list of map, sorting map help

by SourceForge.net :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=5140298
By: ed_j_webb

You are right. The only place you can tell DisplayTag that the column should
be sortable is in the <display:column> tag. You will need to find a way to store
the names of the keys in your maps and iterate through them to create a series
of <display:column> tags:

<display:table name="SearchResult" id= "result" [snip] >
    <c:forEach items="${mykeys}" var="key">
        <display:column property="${key}" sortable="true"/>
    </c:forEach>
</display:table>

Ed!

______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=249317

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
displaytag-user mailing list
displaytag-user@...
https://lists.sourceforge.net/lists/listinfo/displaytag-user
LightInTheBox - Buy quality products at wholesale price