WebWork Frame Select tag

Source: Internet
Author: User

<ww:select/>

Generates a list of select options. The Quot;listkey property is the property used by each element in the list to generate <option> label value. The "ListValue" property fills the option's text label (display name). One major feature is that the appropriate options are automatically selected based on the "value" attribute. If value is equal to the current Listkey, the option is set to selected (if the type matches; see below).

<ww:select label= "' Users '"
Name= "' UserId '"
listkey= "id"
Listvalue= "Name"
List= "App.users"
Value= "App.user.id"
Onchange= "' Chooseuser (This) '"
/>

The following results are generated (assuming Getapp (). GetUser (). GetId () = 2):

<tr>
<td>Users</td>
<td>
<select name= "UserId" onchange= "Chooseuser (This)" >
<option value= "1" >
User Number One
</option>
<option value= "2" selected= "selected" >
User Number Two
</option>
</select>
<td>
</tr>

Of course, the <td> format depends on the template you use.

usage Examples

<ww:select label= "' Pets '"
        name= "' Petids '
         list= "Petdao.pets"
        listkey= "id"
        listvalue= "name"
        Multiple= "true"
        size= "3"
         required= "true"
/>

<ww:select label= "' Months '
         name= "' months '" "
        list=" #{': ' Before--"," ': ' Feb ', [...]} "
        value= "Selectedmonth"
         required= "true"
/>

//The Month ID (.) returned by the Getselectedmonth () call
//again St The stack would be auto-selected

Note: For any label that uses the list data (select may be the most common), it uses the OGNL list notation (see the example above "months"), and note that the key values (in the months example, ' 01 ', ' 02 ', and so on) are manually entered. ' 1 ' is a character, ' 01 ' is a string, ' 1 ' is a string. If the values returned by the Value property are not the same as the key value types in the list, they cannot be matched even if the string values are the same. If it does not match, the list will not have an automatically selected option. Property

name

Required

Description

Id

Whether

ID attribute of HTML

Name

is

The Name property of the HTML

Value

Whether

Field value

List

Whether

The iteration data source used by the list, if the strong table is a map (key, value), the key will be the value of option, value as its content (body)

Listkey

Whether

The key Value property of a list object

ListValue

Whether

Content Properties for list objects

Headerkey

Whether

The first option's build value

Headervalue

Whether

The value of the first option

Emptyoption

Whether

Do you want to add a blank (--) option after the option header (header option)

Multiple

Whether

Do you want to allow multiple selections?

Size

Whether

Size property of HTML

Disabled

Whether

Disabled properties of HTML

TabIndex

Whether

TabIndex Properties of HTML

OnChange

Whether

onchange Properties of HTML

OnClick

Whether

The OnClick property of HTML

Label

Whether

For label text in a template

LabelPosition

Whether

Label Alignment (Left,right,center)

Required

Whether

is a required field when the form is submitted

CssClass

Whether

The class attribute of HTML

CSSStyle

Whether

The Style property of HTML

Theme

Whether

Topics to use

Template

Whether

Template name to use

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.