Re: Object property initialization problem
Re: Object property initialization problem
- Subject: Re: Object property initialization problem
- From: Randall Perry <email@hidden>
- Date: Tue, 20 Apr 2004 19:41:55 -0400
on 4/20/04 6:13 PM, Arturo Perez at email@hidden wrote:
> Randall Perry wrote:
>> Got a Direct Action that calls a component page, ResultPage, passing it a
>> EOGenericRecord object, CustView, that's populated with data.
>
> Is CustView a class or an instance?
It's a class generated by EOModeler.
> BTW, what platform are you
> developing on?
Mac OS 10.
>How is that object being passed to/through the DA?
>
In the DA custInfo is an NSArray retrieving data:
custInfo = ec.objectsWithFetchSpecification(fetchSpec);
Then it passes the first obj in the array to ResultPage's custInfo:
nextPage.takeValueForKey((CustView)custInfo.objectAtIndex(0),
"custInfo");
>> Am able to access properties of the CustView object in the component (via
>> .wod file). But need to access a property of the object in a method in
>> ResultPage.java.
>
> Well, you could do it the same way WO does (the way the component does):
>
> (whatever your EOGenericRecord is called).valueForKeyPath("userName");
Ok, got it to work with this:
String custDir = (String)custInfo.valueForKeyPath("userName");
But also like this:
String custDir = custInfo.userName();
My main problem was I forgot to put the () after userName, forgetting it's a
method and not a property (was using the dot notation that WOBuilder
displays: custInfo.userName -- duh!)
--
Randall Perry
sysTame
Xserve Web Hosting/Co-location
Website Development/Promotion
Mac Consulting/Sales
http://www.systame.com/
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.