Re: Reverse For component

2006-02-14 Thread Raul Raja Martinez
Yes that would be more efficient, I'm wondering though about the ognl calculations. It has been many time said in this list how ognl access is slow but I've never tested it. Todd O'Bryan wrote: Assuming accessing elements in the List is O(1) as in ArrayList, it might be more efficient to just

Re: Reverse For component

2006-02-14 Thread Todd O'Bryan
Assuming accessing elements in the List is O(1) as in ArrayList, it might be more efficient to just iterate backwards over the indices: element here Todd On Feb 14, 2006, at 7:50 AM, Inge Solvoll wrote: No problem, just invert the source collection. create a getter method in your java p

Re: Reverse For component

2006-02-14 Thread Raul Raja Martinez
You can use http://java.sun.com/j2se/1.4.2/docs/api/java/util/Collections.html#reverse(java.util.List) public void pageBeginRender() { setInvertedCollection(Collections.reverse(mylist)); } public abstract void setInvertedCollection(List list); public abstract List getInvertedCollection();

Re: Reverse For component

2006-02-14 Thread Inge Solvoll
No problem, just invert the source collection. create a getter method in your java page class (getInvertedCollection()) that reads the first collection and sorts it the way you want, then point the source-attribute of the for-component to the new method On 2/14/06, Jean-Eric Cuendet (JeSC) <[EM