• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: WOToManyRelationship trouble
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WOToManyRelationship trouble


  • Subject: Re: WOToManyRelationship trouble
  • From: Amedeo Mantica <email@hidden>
  • Date: Fri, 20 May 2005 21:30:50 +0200

Hi Chuck,

I re-read my documentation about relationships...

I changed way to insert the accessories

If i do, as in most WO examples, ad add accesssory function to the car, then set the relationship before i actually insert the accessory object works fine.
and if i go later in the accessory object the WOToManyRelationship works and allow me tho change relation.


Doing so the user must insert the car, then add an accessory to the car inside the car pages clicking (add accessory for this car), but is not user friendly.
My goal was to insert all the cars into the database, and then the accessories, showind in the new accessory page the list of cars available via the TOManyRelationship extension.
Looking for a workaround.. :=)
Thanks for your help, if you have some more suggestion.... thanks again
Amedeo



On 20/mag/05, at 19:09, Chuck Hill wrote:


On May 20, 2005, at 9:59 AM, Amedeo Mantica wrote:


maybe...
what you mean?

the accessiories is in the editing contect, non the car (the relating to object).


That is your problem. See http://wodev.spearway.com/cgi-bin/ WebObjects/WODev.woa/wa/Main?wikiPage=EOFCommandments



how can i insert the cars into the editing context if is occupied my the accessory?


It seems that you do not understand how these objects work. I suggest that you take a break and read some of the EOF documentation and look at how some of the example and tutorials work.


Chuck




On 20/mag/05, at 18:05, Chuck Hill wrote:


Are you relating the Accessories to an object that has not yet been inserted into an editing context?

Chuck


On May 20, 2005, at 3:50 AM, Amedeo Mantica wrote:



thanks for the help, but still having trouble

the binding seem to be set correctly

the sourceObject is binded to the Accessioruis Object
the source entity name is binded to the entity name of the accessorio object in eomodeler
the relationshipkey is binded to the relationship name in eomodeler


teh component correcly display the list of available cars in the page, but when i click submit i got the error.
Do anyone have an example usign the WOToManyRealationship extension?
Thanks
Amedeo


On 20/mag/05, at 02:47, Chuck Hill wrote:



The source for these components is on your machine at

/Developer/Examples/JavaWebObjects/Source/JavaWOExtensions

This is where the execption happens, last line:
    public void updateSourceObject(NSArray newValues) {

// add new values to relationship, remove old values
Object aSourceObject = _localSourceObject();
boolean isDictionary = (aSourceObject instanceof NSMutableDictionary);
NSMutableDictionary _dictionary = (isDictionary) ? (NSMutableDictionary) aSourceObject : null;
EOEnterpriseObject _eo = (!isDictionary) ? (EOEnterpriseObject) aSourceObject : null;
String masterKey = _localRelationshipKey();
NSMutableArray currentValues = (NSMutableArray) NSKeyValueCoding.Utility.valueForKey(aSourceObject, masterKey);
int count = currentValues.count();


Thus, NSKeyValueCoding.Utility.valueForKey(aSourceObject, masterKey) returns null. In other words, sourceObject.valueForKey(masterKey) returns null. Check the spelling of your bindings. It looks like you have misspelled the tomany relation.

Chuck





On May 19, 2005, at 12:18 PM, Amedeo Mantica wrote:




Here the exception:

Any help apprecciated!
THANKS


Error: java.lang.NullPointerException

Reason:


Stack trace:

File
Line#
Method
Package


WOToManyRelationship.java 348 updateSourceObject com.webobjects.woextensions

WOToManyRelationship.java
421
setSelections
com.webobjects.woextensions

NativeMethodAccessorImpl.java
NA
invoke0
sun.reflect

NativeMethodAccessorImpl.java
39
invoke
sun.reflect

DelegatingMethodAccessorImpl.java
25
invoke
sun.reflect

Method.java
324
invoke
java.lang.reflect

NSKeyValueCoding.java
688
setMethodValue
com.webobjects.foundation

NSKeyValueCoding.java
1175
setValueInObject
com.webobjects.foundation

NSKeyValueCoding.java
1293
takeValueForKey
com.webobjects.foundation

WOComponent.java
1550
takeValueForKey
com.webobjects.appserver

NSKeyValueCoding.java
519
takeValueForKey
com.webobjects.foundation

NSValidation.java
733
validateTakeValueForKeyPath
com.webobjects.foundation

WOComponent.java
1273
validateTakeValueForKeyPath
com.webobjects.appserver

WOKeyValueAssociation.java
71
setValue
com.webobjects.appserver._private

WOComponent.java
756
setValueForBinding
com.webobjects.appserver

WOCheckboxMatrix.java
108
setSelections
com.webobjects.woextensions

NativeMethodAccessorImpl.java
NA
invoke0
sun.reflect

NativeMethodAccessorImpl.java
39
invoke
sun.reflect

DelegatingMethodAccessorImpl.java
25
invoke
sun.reflect

Method.java
324
invoke
java.lang.reflect

NSKeyValueCoding.java
688
setMethodValue
com.webobjects.foundation

NSKeyValueCoding.java
1175
setValueInObject
com.webobjects.foundation

NSKeyValueCoding.java
1293
takeValueForKey
com.webobjects.foundation

WOComponent.java
1550
takeValueForKey
com.webobjects.appserver

NSKeyValueCoding.java
519
takeValueForKey
com.webobjects.foundation

NSValidation.java
733
validateTakeValueForKeyPath
com.webobjects.foundation

WOComponent.java
1273
validateTakeValueForKeyPath
com.webobjects.appserver

WOKeyValueAssociation.java
71
setValue
com.webobjects.appserver._private

WOGenericElement.java
74
takeValuesFromRequest
com.webobjects.appserver._private

WOGenericContainer.java
16
takeValuesFromRequest
com.webobjects.appserver._private

WODynamicGroup.java
81
takeChildrenValuesFromRequest
com.webobjects.appserver._private

WODynamicGroup.java
89
takeValuesFromRequest
com.webobjects.appserver._private

WOComponent.java
914
takeValuesFromRequest
com.webobjects.appserver

WOComponentReference.java
97
takeValuesFromRequest
com.webobjects.appserver._private

WODynamicGroup.java
81
takeChildrenValuesFromRequest
com.webobjects.appserver._private

WODynamicGroup.java
89
takeValuesFromRequest
com.webobjects.appserver._private

WOConditional.java
41
takeValuesFromRequest
com.webobjects.appserver._private

WODynamicGroup.java
81
takeChildrenValuesFromRequest
com.webobjects.appserver._private

WODynamicGroup.java
89
takeValuesFromRequest
com.webobjects.appserver._private

WOComponent.java
914
takeValuesFromRequest
com.webobjects.appserver

WOComponentReference.java
97
takeValuesFromRequest
com.webobjects.appserver._private

WODynamicGroup.java
81
takeChildrenValuesFromRequest
com.webobjects.appserver._private

WODynamicGroup.java
89
takeValuesFromRequest
com.webobjects.appserver._private

WOForm.java
70
takeValuesFromRequest
com.webobjects.appserver._private

WODynamicGroup.java
81
takeChildrenValuesFromRequest
com.webobjects.appserver._private

WODynamicGroup.java
89
takeValuesFromRequest
com.webobjects.appserver._private

WOComponent.java
914
takeValuesFromRequest
com.webobjects.appserver

WOSession.java
1139
takeValuesFromRequest
com.webobjects.appserver

WOApplication.java
1350
takeValuesFromRequest
com.webobjects.appserver

WOComponentRequestHandler.java
189
_dispatchWithPreparedPage
com.webobjects.appserver._private

WOComponentRequestHandler.java
287
_dispatchWithPreparedSession
com.webobjects.appserver._private

WOComponentRequestHandler.java
322
_dispatchWithPreparedApplication
com.webobjects.appserver._private

WOComponentRequestHandler.java
358
_handleRequest
com.webobjects.appserver._private

WOComponentRequestHandler.java
432
handleRequest
com.webobjects.appserver._private

WOApplication.java
1306
dispatchRequest
com.webobjects.appserver

WOWorkerThread.java
173
runOnce
com.webobjects.appserver._private

WOWorkerThread.java
254
run
com.webobjects.appserver._private

Thread.java
552
run
java.lang


NA : Non applicable, JIT activated



On 18/mag/05, at 19:39, Chuck Hill wrote:


On May 18, 2005, at 1:59 AM, Amedeo Mantica wrote:


Hi, I have a DB with this entinies: Cars and Accesories... I need to do a to many relationship between this two entities

a Car can have many Accessories

I made the relationship with EOModeler without any problem, than added in my accessiories component page a WOToManyRelationship binding the relationshipkey with the name of the relationship, the sourceObject with the accessiories object and the source entity name with tha name of the entity accessiories.
Wen i load the accessiories compnent the WOToManyRelationship display me the list of Cars that I can choose, correctly.
But when I submit the form I obtain an exception.
Can anyone help me with this?



Exceptions are important. They provide valuable clues as to what went wrong. Try carefully reading all the details of the exception. Can you spot the problem? If not, post the entire exception with stack trace here and perhaps we can help. Otherwise we are just guessing.


Chuck

--
Practical WebObjects - a book for intermediate WebObjects developers who want to increase their overall knowledge of WebObjects, or those who are trying to solve specific application development problems.
http://www.global-village.net/products/practical_webobjects









--
Practical WebObjects - a book for intermediate WebObjects developers who want to increase their overall knowledge of WebObjects, or those who are trying to solve specific application development problems.
http://www.global-village.net/products/practical_webobjects










--
Practical WebObjects - a book for intermediate WebObjects developers who want to increase their overall knowledge of WebObjects, or those who are trying to solve specific application development problems.
http://www.global-village.net/products/practical_webobjects








--
Practical WebObjects - a book for intermediate WebObjects developers who want to increase their overall knowledge of WebObjects, or those who are trying to solve specific application development 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
  • Follow-Ups:
    • Re: WOToManyRelationship trouble
      • From: Chuck Hill <email@hidden>
References: 
 >WOToManyRelationship trouble (From: Amedeo Mantica <email@hidden>)
 >Re: WOToManyRelationship trouble (From: Chuck Hill <email@hidden>)
 >Re: WOToManyRelationship trouble (From: Chuck Hill <email@hidden>)
 >Re: WOToManyRelationship trouble (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: Problem with snapshot <--> entity not in sync
  • Next by Date: Re: WOToManyRelationship trouble
  • Previous by thread: Re: WOToManyRelationship trouble
  • Next by thread: Re: WOToManyRelationship trouble
  • Index(es):
    • Date
    • Thread