• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: onChange with WOPopUpButton
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >onChange with WOPopUpButton (From: Darich Runyan/OMNI INFOSEC HQ <email@hidden>)
 >Re: onChange with WOPopUpButton (From: Darich Runyan/OMNI INFOSEC HQ <email@hidden>)

  • Prev by Date: Re: Framework EOModel Question
  • Next by Date: WOCollapsibleComponentContent 'framework' evaluated to null
  • Previous by thread: Re: onChange with WOPopUpButton
  • Next by thread: Re: onChange with WOPopUpButton
  • Index(es):
    • Date
    • Thread