• 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: newbie question regarding WOPopUp
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: newbie question regarding WOPopUp


  • Subject: Re: newbie question regarding WOPopUp
  • From: "Pierce T. Wetter III" <email@hidden>
  • Date: Tue, 30 May 2006 12:07:13 -0700


On May 30, 2006, at 11:45 AM, Timmy wrote:

Pierce,

Thanks for the tip. When I bind my selectedBuilding variable to "value" I actually get null in my DirectAction for request ().formValueForKey("buildingString"). So, actually a step back - or I'm doing something else wrong. Here is what my current bindings look like.

displayString		currentBuilding
item				currentBuilding
list				buildingList (instantiated as indicated below)
name			"buildingString"
selection		selectedBuilding
value			selectedBuilding


 Oh, you're at the WOBuilder level.

 Short answer: bind value to currentBuilding.

 Long Answer:

It's important when learning WO to make lots of use of "View Source" in FireFox to reverse-engineer what WO is doing on the HTML level. This is especially useful for something like WOPopupButton which writes multiple HTML tags.

  In order to build a popup in HTML, you have to write out

 <select name="x">

  <option name="blah" value="1">
  <option name="foo" value="2">
 </select>

If you were doing this by hand, you'd end up writing out the select tag, then writing out each option via a WORepetition.

So if you look at the list of bindings, that's where those come from. Some of those bindings are for the repetition, some are for the popup as a whole.

list: the list for the WORep.
item: the item for the worep
displayString: "name" for the option tag, usually going to be item.something
value: "value" for the option tag, usually going to be item.something. This is optional, if you leave it out, WO will create it's own (useful for selection below)
name: the name of the _select_ tag, for the form
selection: WO will compare the binding of value to this binding when writing out the option tags, if they match, then that item is considered selected. When reading a value from a form, it does this in reverse.


That's the basics. There's some more voodoo that happens when mapping between "selection" and the list items with component actions, but that shouldn't concern you, since you're using a direct action and pulling the forum values.

 Pierce
_______________________________________________
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


  • Follow-Ups:
    • Re: newbie question regarding WOPopUp
      • From: wojingo <email@hidden>
References: 
 >newbie question regarding WOPopUp (From: Timmy <email@hidden>)
 >Re: newbie question regarding WOPopUp (From: "Pierce T. Wetter III" <email@hidden>)
 >Re: newbie question regarding WOPopUp (From: Timmy <email@hidden>)

  • Prev by Date: Re: newbie question regarding WOPopUp
  • Next by Date: Re: Setting a Default toOne Relationship
  • Previous by thread: Re: newbie question regarding WOPopUp
  • Next by thread: Re: newbie question regarding WOPopUp
  • Index(es):
    • Date
    • Thread