• 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: Custom EOSortOrdering for a WODisplayGroup
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom EOSortOrdering for a WODisplayGroup


  • Subject: Re: Custom EOSortOrdering for a WODisplayGroup
  • From: Paul Hoadley <email@hidden>
  • Date: Thu, 6 May 2010 19:59:27 +0930

On 06/05/2010, at 4:41 PM, Timo Hoepfner wrote:

> I did something similar before. I basically took the "Strings" class from here:
>
> <http://weblogs.java.net/blog/skelvin/archive/2006/01/natural_string.html>
>
> and wired it up in a EOSortOrdering.ComparisonSupport subclass derived from ERXComparisonSupport. I attached a cleaned up version of the file.
>
> Then add something like this to your Application (if it extends ERXApplication):
>
> @Override
> public void finishInitialization() {
> 	super.finishInitialization();
> 	NaturalOrderStringSortSupport.initialize();
> }
>
>
> As Johann pointed out before, this is then globally used for all String sorting.

Thanks Timo.  Very helpful.

If the list could just bear with me for a little longer...  I take it that I've fundamentally misunderstood what an EOSortOrdering is doing.  When I wanted to create an EOSortOrdering that sorts in some particular way _on some particular EO's attribute_, there's actually no such thing—right?  An EOSortOrdering takes a key, but then sorts in a pre-defined way based on the type of the key (and the NSSelector supplied)—right?  So I've really only got the following options:

1.  Take Timo and Johann's advice, and implement a custom sorting algorithm that would be used globally for all Strings.
2.  Change the Java type of that attribute to some custom type (that presumably includes a String by composition), implement the sorting algorithm for that type, and register that for global use as described.  (Is that even feasible?  Sounds like a lot of work.)
3.  Stick with the current hack that will break if the attribute value can't be cast to an Integer.

Any other options?  Or do I sound completely insane?


--
Paul.

http://logicsquad.net/


 _______________________________________________
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

  • Follow-Ups:
    • Re: Custom EOSortOrdering for a WODisplayGroup
      • From: Chuck Hill <email@hidden>
    • Re: Custom EOSortOrdering for a WODisplayGroup
      • From: Mark Wardle <email@hidden>
References: 
 >Custom EOSortOrdering for a WODisplayGroup (From: Paul Hoadley <email@hidden>)
 >Re: Custom EOSortOrdering for a WODisplayGroup (From: Johann Werner <email@hidden>)
 >Re: Custom EOSortOrdering for a WODisplayGroup (From: Paul Hoadley <email@hidden>)
 >Re: Custom EOSortOrdering for a WODisplayGroup (From: Timo Hoepfner <email@hidden>)

  • Prev by Date: Re: Switch from 5.3.3 to 5.4.3 breaks tomcat deployment
  • Next by Date: Re: Custom EOSortOrdering for a WODisplayGroup
  • Previous by thread: Re: Custom EOSortOrdering for a WODisplayGroup
  • Next by thread: Re: Custom EOSortOrdering for a WODisplayGroup
  • Index(es):
    • Date
    • Thread