• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Sorting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: Sorting
  • Next by Date: manually creating eo's
  • Previous by thread: Re: Sorting
  • Next by thread: AW: Sorting
  • Index(es):
    • Date
    • Thread