A minor correction to Matt's example:

| together, listKey and listValue resolve as  ....
| <option value="{listValue}">listKey</option>

Actually, the listKey is assigned to the option value, and the listValue
is the option display. I know the names seem confusing, but that
actually makes sense -- the key holds the data you're interested in and
the value is the display stuff. Since you're interested in the key, in
HTML that data goes in <option value="...">. Besides, that's how 1.3
works :)

-Pat

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Matt Ho
Sent: Tuesday, October 21, 2003 5:45 PM
To: [EMAIL PROTECTED]
Subject: Re: [OS-webwork] select tag in Velocity

Robert Douglass wrote:

> Hi all. If anyone can explain to me how to use the #tag(Select ...)
without
> having to make my own inner-class Node implementations, I will update
the
> Wiki with clear examples and a thorough and clear text. Don't do it
for me.
> Do it for the next guy who downloads WW2 and asks what all these
attributes
> are for: theme, template, label, required, name, value, list, listKey,
> listValue, defaultValue, defaultKey, emptyOption, multiple, size

here's a quickie rundown:

* theme -- the prefix of the velocity template, defaults to
templates/xhtml
* template -- the name of the velocity template

together theme + template form the template to look up.

* label -- the ognl resolved value to the left of the select list.  will

be resovled against action.getText(...) if it's there
* name -- name of the select input field  <select name="...">
* value -- the ognl resolved value for the select
* list -- the collection or array that contains the values for the 
select tag
* listKey -- the ognl expression to be applied against each element of 
the collection / array specified in the list attribute
* listValue -- the ognl expression to be applied against each element of

the collection / array specified in the list attribute

together, listKey and listValue resolve as  ....
<option value="{listValue}">listKey</option>

* defaultValue / defaultKey -- default values for the list
* multiple -- whether or not it's a pulldown list of a select list
* size -- if it's a list box, how many elements to display

This is off the top of my head so I might be a little off.

M





-------------------------------------------------------
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork


-------------------------------------------------------
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to