Thanks Kieran. Good advice. Off the top it appears I might still have trouble with my batch navigation bar (any thoughts on that?) but I'll give it a go.
Kieran Kelleher wrote:
Clarification, I would of course make a local instance in the same ec as the display group before doing that! :-) IIRC, ERXBatchingDisplayGroup may have some behaviours that are different to regular ERXDisplayGroup .... but cannot remmeber off the top of my head.

On Dec 4, 2009, at 10:43 AM, Kieran Kelleher wrote:

Hi Jon,

I typically use a peer ec, and once user submits the new item, I would do sth like this (which I just copied/pasted from working code. BTW, the display group is ERXDisplayGroup and is using a DetailDataSource in this case:

recipientsDisplayGroup().insertObjectAtIndex(newRecipient, 0);
           recipientsDisplayGroup().setSelectedObject(newRecipient);
recipientsDisplayGroup().displayBatchContainingSelectedObject();

Note I insert new ones in furst position of first page just so user gets visual feedback. You can insert wherever.

Slán, Kieran

On Dec 4, 2009, at 9:54 AM, Jon Nolan wrote:

I have had a problem with variations on this since my early days with WO and I've never solved it to my satisfaction. Time to ask for help.

* Page has a display group (ERXBatchingDisplayGroup) using EC1 in the fetch spec. For the sake of example the EOs in the list are colors - 25 total with 10 on each page. Colors are sorted by name.

* The second page contains GREEN through PINK. User clicks on ADD COLOR.

* Lightbox (AjaxModalDialog) appears and allows user to edit the new color in a peer or nested editing context - EC2. My usual approach is to use a nested ec.

* User adds ORANGE and saves changes. Lightbox disappears. Container surrounding the display group is updated.

What is the best way to update the display group at this time? I've tried calling fetch(), redisplay(), updateDisplayedObjects(), combinations of the above, etc. with various levels of success but I always run into trouble with something. Either the list doesn't refresh correctly re: sort order or the batch navigation bar doesn't know when the batch count increases. The only sure fire way I've found is nullifying the display group and starting over. This seems very inefficient and I'm sure I'm missing something.

I don't want to use the same editing context to edit as I need to discard the insert on cancel/overlay dismissal of the AMD. I realize it is possible to use a single ec and revert but it grates me to jump through those hoops when a second ec is so easy. The only problem I have with the latter is getting my display group and associated batch navigation bar updated consistently and correctly.

Thanks in advance,
Jon

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

This email sent to arch...@mail-archive.com

Reply via email to