Re: ObjectNotAvailableException: when saving a simple relationship
Re: ObjectNotAvailableException: when saving a simple relationship
- Subject: Re: ObjectNotAvailableException: when saving a simple relationship
- From: Gustavo Pizano <email@hidden>
- Date: Thu, 16 Jul 2009 10:37:18 +0200
Lachlan hello..
Yeah about the classnames it was damn mistake I did when creating the EOModel, my bad.
selectedList is a NSArray<TranslationSet> that comes form the binding selections form the WOBrowser. The list that feeds the WOBrowser its being created like
contentsList = (NSMutableArray<TRANSLATIONSET>) selectedWG.toTranslationSets().valueForKey(_WGxTS.T_RANSLATIONSET_KEY);
where selectedWG its the selection of another list, that its being fetched like this:
NSArray aux1 = _WG.fetchAllWGs(session().defaultEditingContext());
wgList = EOSortOrdering.sortedArrayUsingKeyOrderArray(aux1, new NSArray(new Object[]{EOSortOrdering.sortOrderingWithKey(_WG.PROJECT_NAME_KEY, EOSortOrdering.CompareAscending)}));
so, once again,, when I select an item form wgList, it get binded into selectedWG and then using AjaxUpdateContainerID the other list get its data...
I already saved some information in another requiremente, usign the same procedure, generating contents of main list, then selecting an itme of main list, then selecting another item of the second list and then modifing that last item by adding more stuff to the EO and adding the relationships and so on, and I had no problem
But this time using the same procedure but instead of adding more stuff Im just adding a relationship I get this error.
THe user its being fetched from the WOPopUpList, with the same EC, so I suspeceted it should be there. but no. :S
G.
On Thu, Jul 16, 2009 at 10:18 AM, Lachlan Deck
<email@hidden> wrote:
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