2007/3/16, rene marxis <[EMAIL PROTECTED]>:
Hello
I am new to WO and have some question on WOPopUpButton.
I have one form with 2 fields (name, street) and 2 WOPopUpButtons
(country, cities).
I like the cities popup to change dynamicly when the country changes. All
4 fields are in one WOForm.
To manage this i did the following:
Add one hidden field to the form that i set with
onChange = "document.DataForm.isSelectCountry.value=1;this.form.submit();return
false;";
This feld is of course bound to one String in the class.
All other WOText elemets are bound to some item coming from DB.
On Submit of the form (which is an action DoSave) i do check the
isSelectCountry and if it is .equals("1") i do set it back to "0" and just
return null.
This seems to work ok. but i get some message on the console from the
workerthread, that my entity "name" which is defined "not null" in the my
model, is not allouwed to be null when adding a new item and don t have data
entered for the name and/or street.
First question: Is this the way to manage such situations or is there some
better one. Probaby something like ajax?
Exaclty: look the DependentListsExample int AjaxExample, you can download it
in http://webobjects.mdimension.com/wonder/
Second: How can i overcome the "null" problem?
when you add the bind value to the TextField, don't use a variable, but the
pair of get/set methods, and, in the set, check if the value passed is null,
if so, use a default value (e.g. "_NULL_").
Many thanks in advance
rene
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/ildenae%40gmail.com
This email sent to [EMAIL PROTECTED]
--
Daniele Corti
AIM: S0CR4TE5
Messenger: [EMAIL PROTECTED]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]