Re: ObjectNotAvailableException: when saving a simple relationship
Re: ObjectNotAvailableException: when saving a simple relationship
- Subject: Re: ObjectNotAvailableException: when saving a simple relationship
- From: Lachlan Deck <email@hidden>
- Date: Thu, 16 Jul 2009 18:18:51 +1000
On 16/07/2009, at 5:40 PM, Gustavo Pizano wrote:
Ok this is really simple but somehow its not working.
I have a list of EO's (TRANSLATIONSET) in a WOBrowser, I have multiple
selections to ture and with their proper bindings, also I have a
WOpopUpButton that displays a list of USERS, item : USER and
selection=
selectedUser<USER>. now I have and AjaxSubmitButton that forward the
information to a static methihod in the Administrator tools
<WOComponent> so
this is what Im doing in .
in the WOComponent that has the List of TRANSLATIONSETS
public WOActionResults asingToTranslator() {
return
AdminTools
.asingToTranslator
(session().defaultEditingContext(),selectedList,userSelection);
}
in the AdministratorTools:
public static WOActionResults asingToTranslator(EOEditingContext
ec,
NSArray<TRANSLATIONSET> selectedTrans, USER user) {
NSLog.out.appendln(">>>asingToTranslator>> HERE HERE HERE");
NSLog.out.appendln(ec.globalIDForObject(user));
NSLog.out.appendln(selectedTrans.size());
for(TRANSLATIONSET ts:selectedTrans){
what is this following line doing?
ec.insertObject(ts);
How was ts created? Why aren't you using EOUtilities.create...? or
TRANSLATIONSET.create(ec)?
And why are your classnames in ALLCAPS?
ts.setToUserRelationship(user);
}
ec.saveChanges();
return null;
}
when I set the relationship ts.setToUserRelationShip(user) I got the
exception.. I tought that the slectedUser wasn't inserted in the EC,
so then
I add the folloing before the for-loop. USER userAux =
USER.fetchUSER(ec,USER.NAME.eq(user.name()));
and instead of argument user I passed userAux. but still I have the
same
ObjectNotAvailableException: No xws.localizer.eo.USER found with
globalID:
<USER: [id: '0'] >.
why is this happening?
Thx
G.
_______________________________________________
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
with regards,
--
Lachlan Deck
_______________________________________________
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