Le 05-12-04, à 14:24, Jan Verrept a écrit :

I've made a Class "Language" containing two vars "language" and "languageCode" of type String

In Session I create and populate an NSMutableArray "languages" of type "Language"
IN SessionI create a var "language" of type Language
In Session I create a var "languageCodeToStore" of type String (the goal of this exercise)

after binding a WOPopupButton as indicated below I get the right DisplayStrings but I can't get de right "languageCodeToStore" to be stored in the Session.
Using <x-tad-bigger>println </x-tad-bigger>the runLog-window shows Null for "Session.languageCodeToStore" after a choose a lunguage from te popup.
I'm desperate working on this for days now. 

languageMenu: WOPopUpButton {


onchange = "this.form.submit();";
noSelectionString = "---";
name = "languageMenu";
displayString = session. language. language;
value = session. language. languagecode;
list = session. languages;
item = session. language;
selectedValue = session. languageCodeToStore;
}

It might just be an email artefact, but there are spaces on the key-path, remove them.

Forget about string/int/basic-type management, WO make you deal with Objects ...
Do not forget that WO encapsulate objects for you, so what you see in a wopopup are objects, not strings. You bind a displayString to show get the right representation, but it's just one of many representation that an object may take. WO will make you deal with objects, not the corresponding values associated.
So the resulting selection will be an object, in this case a Language object.
Change the binding to be :
selectedValue = session.languageToStore;
Where in Session you have a var languageToStore of type Language.

If you want the associated code, ask the languageToStore for it's corresponding code ( langageToStore.languageCode() ).

- jfv

http://www.freeiPods.com/?r=21419063
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to archive@mail-archive.com

Reply via email to