Re: Sorting on integer attribute?
Jean Pierre Malrieu <[email protected]> Tue, 4 Feb 2014 10:10:48 +0100
| Newsgroups | gmane.comp.web.webobjects.wonder-disc |
|---|---|
| Message-ID | <[email protected]> |
Thanks! I would have been surprizing that I'd be the first to face this problem. JPM Le 4 févr. 2014 à 00:32, David Holt <[email protected]> a écrit : > Hi Jean Pierre, > > You'll want to check out Timo's solution in this thread: > > http://lists.apple.com/archives/webobjects-dev/2010/May/msg00086.html > > I've included his classes in this email for your convenience. > > It has worked very well for me for years. > > David > > ============== > > 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. > > HTH, > > Timo > > > =================== > > > > <NaturalOrderStringSortSupport.java> > <Strings.java> > > > On 2014-02-01, at 1:11 AM, Jean Pierre Malrieu <[email protected]> wrote: > >> Hi, >> >> I want to sort the items in a popup (D2W, ERD2WEditToOneRelationship) >> I am sorting them on an integer attribute. Suppose there are 12 items. The resulting sort is: >> >> 1 >> 11 >> 12 >> 2 >> 3 >> Etc... >> >> Is there a way to specify I want a numerical ordering, not alpha numerical? >> >> TIA >> >> JPM >> ------------------------------------------------------------------------------ >> WatchGuard Dimension instantly turns raw network data into actionable >> security intelligence. It gives you real-time visual feedback on key >> security issues and trends. Skip the complicated setup - simply import >> a virtual appliance and go from zero to informed in seconds. >> http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk >> _______________________________________________ >> Wonder-disc mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/wonder-disc > ------------------------------------------------------------------------------ Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk _______________________________________________ Wonder-disc mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wonder-disc