Re: WOPopupButton Novice help
Re: WOPopupButton Novice help
- Subject: Re: WOPopupButton Novice help
- From: David Griffith <email@hidden>
- Date: Mon, 23 Feb 2004 14:27:21 +0100
HI,
The selection (in this case locationSelection is a object of type Location.
Since the competitionLocation is an object of type Location (as you have
defined in your class below) then the selection will also be of type
Location.
In your code, you can refer to the name of the selectedLocation by:
selectedLocation.locationName();
You use locationName() as a method here because your Location class should
have a getter method by that name which will return the name.
Hope this helps you!
Dave.
> Hello!
>
> I am new to WebObjects and apologize for my ignorance ;)
>
> I am trying to take the column Name from a database table Location and
> display it in a popup button. I have the following code in the Session
> class:
>
> // Fetch Location table
> EOFetchSpecification fetchSpecA;
> EOEditingContext ecA = defaultEditingContext();
> fetchSpecA = new EOFetchSpecification("Location", null, null);
> NSArray locationTemp = ecA.objectsWithFetchSpecification(fetchSpecA);
> competitionNameArr = new NSMutableArray(locationTemp);
>
>
> Then I have the following attributes on the popup button in SetLocation.wo:
> The popup button displays perfectly. It's just getting the selection which
> is the problem.
>
> displayString competitionLocation.locationName
> item competitionLocation
> list session.competitionNameArr
> selection locationSelection
>
> In SetLocation.java I added:
>
> protected Location competitionLocation
>
>
> Now, when I return locationSelection, I get the following output:
>
> {values = {matchloc = " )>"; competitionType = "Regional"; name = "New
> Jersey"; comments = ; }; this = " "; }
>
> My question is: How can I get just the name key, and have it in the form of
> a string?
>
>
> Thank you in advance,
> Greg Liebowitz
> _______________________________________________
> 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.
_______________________________________________
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.