Michael,
Since it's already done through the TreeMap and TreeSet collection classes, 
I don't think it's necessary to implement it again in the logic:iterate 
tag. If you want to access members of a collection in a sorted order, then 
use the TreeMap or TreeSet as the collection and invoke the sort() method 
on it before using the iterate tag.

Regards,

Richard

At 10:08 PM 5/13/2002 -0700, you wrote:
>I'm looking for sorting support for the Struts Logic Iterate tag. Struts
>Layout by Improve claims to support something like this for their Collection
>library.  However, I found their latest release (docs and examples) in
>disarray.  Also, in the archives I see a message (RE: sorting in
>logic:iterate) from Tim Sawyer where he claims to have implemented sorting
>classes to solve this problem -- but, I don't see any code.
>
>Ideally, I would like to see something like what Sawyer claims or markup
>something like the following:
>
><logic:iterate id="element" name="myhashtable" sortby="value1,value2,value3"
>sortorder="ascending">
>Next element is <bean:write name="element" property="value1"/>
>Next element is <bean:write name="element" property="value2"/>
>Next element is <bean:write name="element" property="value3"/>
></logic:iterate>
>
>Here, "myhashtable" would be sorted in ascending order based on comparable
>"value1", "value2", "value3" of each "element".
>
>If there's nothing within Struts that solves this problem then I would like
>to work on extending the "iterate" tag to handle this.  Please let me know
>what you think.
>
>Thanks,
>
>--Michael T. Marrotte
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to