Re: onChange with WOPopUpButton
Re: onChange with WOPopUpButton
- Subject: Re: onChange with WOPopUpButton
- From: LD <email@hidden>
- Date: Sat, 6 Aug 2005 12:34:56 +1000
Hi there,
On 06/08/2005, at 11:21 AM, Darich Runyan/OMNI INFOSEC HQ wrote:
What I have is a set of WOConditionals, each with a specific
component that will load if the conditional is true. I would like
the determination of which conditional appears based on the
selection made in the WOPopUpButton.
So you're wanting a variable set to the selection of the popup upon
form submission. Easy. The trick is with the bindings Below is a
working example.
CategorySelectionPopUpButton: WOPopUpButton {
list = categories;
selection = selectedCategory;
noSelectionString = "-- select category --";
displayString = selectedCategory.name;
item = aCategory;
onChange = "javascript:this.form.submit();";
}
ViewCategorySubmitButton: WOSubmitButton {
action = viewSelectedCategory;
value = "View Category";
}
Form1: WOForm {
}
Now, when the form is submitted and when your component action is
given control the selectedCategory variable has the user selection.
Now, instead of having numerous booleans in your code, you can
utilise the cool WOKeyValueConditional to show the relevant component...
ShowHelicopterConditional: WOKeyValueConditional {
key = "selectedCategory.name";
value = "Helicopter";
}
ShowFixedWingConditional: WOKeyValueCondtional {
key = "selectedCategory.name";
value = "Fixed Wing";
}
with regards,
--
LD
_______________________________________________
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