Re: Display group design question
Re: Display group design question
- Subject: Re: Display group design question
- From: Kieran Kelleher <email@hidden>
- Date: Fri, 4 Dec 2009 11:52:57 -0500
For Ajax pages I use Wonder's AjaxFlickrBatchNavigation. That needs to
be inside the update container too.
On Dec 4, 2009, at 11:22 AM, Jon Nolan wrote:
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden