Re: newEO.localInstanceIn(localEditingContext)
Re: newEO.localInstanceIn(localEditingContext)
- Subject: Re: newEO.localInstanceIn(localEditingContext)
- From: Chuck Hill <email@hidden>
- Date: Thu, 26 Mar 2009 14:05:13 -0700
On Mar 26, 2009, at 1:44 PM, Ricardo J. Parada wrote:
Yes, you are right... I better comment on the context. :-)
I'm playing with ajax tabbed panel and tabs.
Each component in a tab is getting its own editing context. Its own
sandbox. :-)
If the user is editing something in tab1 (i.e. has pending edits),
he can switch to tab2 and change something there and save that...
then come back to tab1 and the changes there are still pending and
he can click save there. Anyways, each tab has its own sandbox.
But this design breaks when you have a new EO because you cannot
make a copy of the EO into the other editing contexts used by the
other tabs.
And I think it also breaks if I attempt to make a copy of the EO if
it has pending changes from tab1 for example (right?).
So... I could change it to have all the tabs share the editing
context and would probably make things easier... I just wished I
could have the tab submit the form within the displayed tab when the
user switches tabs... Otherwise the user will change something in a
text field in tab1 then switch to tab2 and then back to tab1 and
notice that the change made in the text field was lost.
Thanks,
Ricardo
Have one EC for the tab form as whole, and one child EC for each tab.
I think that will do what you want.
Chuck
On Mar 26, 2009, at 4:22 PM, Ken Anderson wrote:
Ricardo,
As others have pointed out, this is not allowed. If you let us
know the context you want to use it in, maybe we can suggest
alternatives...
Ken
On Mar 26, 2009, at 3:16 PM, Ricardo J. Parada wrote:
Hi All,
If I have an EO that has not been saved to the database (i.e.
newFoo in my code below), is it possible to do the following:
Foo localFoo = newEO.localInstanceIn(localEditingContext());
Normally I get the error:
java.lang.IllegalStateException: You attempted to localInstance
<com.model.Foo pk:"null">, which has not yet committed.
But I think that it should be allowed, even if that requires that
I get a primary key for localFoo.
Does anybody know if that can be accomplished??
_______________________________________________
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
_______________________________________________
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
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
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