Re: Sorting
Re: Sorting
- Subject: Re: Sorting
- From: James Cicenia <email@hidden>
- Date: Sun, 31 Oct 2004 18:04:21 -0600
Hi-
I recently did the same thing,,, but, I did it the manual way...
something like
public WOComponent sortType(){
setSort("type");
return null;
}
for each column.
Then I used this code:
public void setSort(String key){
setSort(key,false);
}
public void setSort(String key, boolean descending){
if(!sortKey().equals(key)){
mySortNum = -1;
setSortKey(key);
if(descending){
setSortDirection(EOSortOrdering.CompareDescending);
}else
setSortDirection(EOSortOrdering.CompareAscending);
}else{
mySortNum++;
if(mySortNum==0){
if(descending){
setSortDirection(EOSortOrdering.CompareAscending);
}else
setSortDirection(EOSortOrdering.CompareDescending);
mySortNum=-2;
}else{
if(descending){
setSortDirection(EOSortOrdering.CompareDescending);
}else
setSortDirection(EOSortOrdering.CompareAscending);
}
}
}
If there is a better way, I would like to know because I have to do
this again and probably again.
-j-
On Oct 31, 2004, at 5:28 PM, Greg Hulands wrote:
Hi,
I have read on the list before that using display groups is a bad idea
and should instead use a fetch spec and handle the array myself. In
one component I have the WOBatchNavBar or whatever its called and also
have sort orderings for the columns in the table. I have no problems
fetching and handling the EO's, it is just on how to have an efficient
design of handling when a column gets clicked to be sorted by it. How
have other people implemented sorting in this way?
Regards,
Greg
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >Sorting (From: Greg Hulands <email@hidden>) |