It turns out the header component used was ERMD2WCombinedTableHeader, which, 
when clicked called ERXSortOrder.toggleClicked, which made the call:

            
NSNotificationCenter.defaultCenter().postNotification(SortOrderingChanged,
                                                                  
displayGroup().sortOrderings(),
                                                                  new 
NSDictionary(valueForBinding("d2wContext"), "d2wContext"));

So I put into Session:

                NSNotificationCenter.defaultCenter().addObserver( this,
                                                                  new 
NSSelector( "sortOrderingChanged", new Class[] { NSNotification.class } ),
                                                                  
"SortOrderingChanged",
                                                                  null );

So that I could save the sort orderings in the session and pull them back out 
to sort the values passed into the embedded ERXD2WList's list binding when the 
page is returned to.

Only side effect is that the headers don't know that the values are sorted by 
the cached sort orderings, because the DisplayGroup created in the xxx that 
would normally have the sort orderings when headers are clicked is not passed 
the sort orderings and thus has no sort orderings, just the items already 
pre-sorted.  Then the user clicking the header again, would not get the reverse 
sort.  But not too bad, since the headers make no indication as to the sort 
order anyway.  But if they did indicate the active sort column, I am wondering 
how one might pass down the sort orderings to affect each new DisplayGroup's 
initial sort orderings?  … not a priority question tho.

= Robert =

On Feb 12, 2013, at 9:15 PM, Ramsey Gurley <[email protected]> wrote:

> Oh, never mind. I just realized your talking about an embedded component. 
> Different story. Go with what David said.
> 
> On Feb 12, 2013, at 9:27 AM, Ramsey Gurley wrote:
> 
>> It sounds like a bug to me. When hitting a back link, shouldn't he be 
>> getting the same page instance with the same display group, and thus the 
>> same sort orderings?
>> 
>> ERCore's user prefs will persist the sort orderings for you, but I don't 
>> think that should not be necessary when backtracking.
>> 
>> Ramsey
>> 
>> On Feb 11, 2013, at 10:11 PM, David Holt wrote:
>> 
>>> ERCoreBusinessLogic can save user preferences for sort order. Would 
>>> something in there help you?
>>> 
>>> Sent from my iPad
>>> 
>>> On 2013-02-11, at 9:03 PM, Robert Hanviriyapunt <[email protected]> wrote:
>>> 
>>>> Hi again,
>>>> 
>>>> I have a ERXD2WList [B] in a page/component [A] and have 
>>>> propertyIsSortable = "true" on all properties.  The sorting is all ajax-y 
>>>> and works, but when the user clicks a row to view a single item on a new 
>>>> page, then clicks a "back" link to go back to the list page, the sort is 
>>>> lost.  How can I retain the sort last selected by the user?
>>>> 
>>>> I am about to go crazy on this and replace all the header components with 
>>>> my my own header component hack that calls ognl like 
>>>> ~parent.parent.parent.sortBy( propetyName ) something-or-other if I can't 
>>>> get a clean way to have the list save off the sort key or the sort 
>>>> orderings off, either back to the parent component or the session.  Would 
>>>> that even work?  I have no idea how that ajax stuff works, if [B] still 
>>>> can traverse up the component tree to [A] and set something, and then get 
>>>> fed the new sorted list of stuff as the source of the refreshed table.  Am 
>>>> I talking crazy?
>>>> 
>>>> = Robert =
>>>> _______________________________________________
>>>> Do not post admin requests to the list. They will be ignored.
>>>> Webobjects-dev mailing list      ([email protected])
>>>> Help/Unsubscribe/Update your Subscription:
>>>> https://lists.apple.com/mailman/options/webobjects-dev/programmingosx%40mac.com
>>>> 
>>>> This email sent to [email protected]
>>> 
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be ignored.
>>> Webobjects-dev mailing list      ([email protected])
>>> Help/Unsubscribe/Update your Subscription:
>>> https://lists.apple.com/mailman/options/webobjects-dev/rgurley%40smarthealth.com
>>> 
>>> This email sent to [email protected]
>> 
>> 
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list      ([email protected])
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/webobjects-dev/ramseygurley%40gmail.com
>> 
>> This email sent to [email protected]
> 
> 
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/roberthana%40mac.com
> 
> This email sent to [email protected]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to