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      (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