Re: newbie question regarding WOPopUp
Re: newbie question regarding WOPopUp
- Subject: Re: newbie question regarding WOPopUp
- From: wojingo <email@hidden>
- Date: Wed, 31 May 2006 09:42:03 +0930
Hi,
I dont use direct actions much, but from memory you use the
selectedValue on a WOPopUpButton with DirectActions.
There is a document called WO Dynamic Element reference that lists the
pupose of the bindings for the Dynamic Elements.
cheers,
- shaun
Pierce T. Wetter III wrote:
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
_______________________________________________
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