HTML 009 select

 

This article does not describe select tag in HTML, but describes the JSP <s: select>

About select tag in HTML, and JSP as well as in: the same and the difference <s select> additionally performed subsequent

1: You can use the following method when the fixed options and simple drop-down list of time

< S: SELECT ID = "bizCategory" name = "querybean.bizCategory" Data = "$ {} querybean.bizCategory" List = "# { '': 'Select'; '1': 'WiFi ', '2' : 'mobile network', '3': 'no network'} " > </ S: SELECT >

id: no special purpose, the stack may be operated by JQuery selector element

name: the front and back for data interaction, the presence of a background model driven private EntClientBizQueryBean querybean = new EntClientBizQueryBean ();

data: data for echo

  Here encountered a problem of a null pointer exception, backstage entity class attributes need to set default values ​​for private String bizCategory = ""; you can not use private String bizCategory;

  Property value is not used, there is described information (default value setting added value = "" :) <s: select id = "type" name = "type" class = "ComboType" list = "# { '1': ' WiFi ',' 2 ':' mobile network ',' 3 ':' no network '} "value =" 2 "> </ s: select>

list: static create a Map, map of key value as a drop-down list, the value of the map to show the drop-down list as the value. If you want to set the default values ​​are shown in select multi-mode pass a value for the default selection 

 

HeaderKey explain the two properties and headerValue

  headerKey: The default value for the preference key value is true submitted
  headerValue: Default value preferences such as headerValue = "----------- Please select ------------- - "prompts the user to make a choice.

  

2: When a set of drop-down list using the background found in the database can be used when a method

<s: select id = "adaptRules " name = "adaptRules" class = "adaptrules" list = "adaptruleslist" listKey = "id" listValue = "name"> </ s: select>
Background List Processing in Action method is as follows : first, find the corresponding objects in the collection and then get into the request in jsp page 
which jsp in ListKey is the object id attribute, listValue is the name attribute object

List <ADAPT Rules> adaptation rules list = adaptrulesService.FindAdaptrules ();
request.setAttribute ( "adaptation rules list", adaptation rules list);
对象的信息如下: 

 

 

 

3: You can use the following method when using the drop-down list in the background Map

<s: select id = "mode " name = "mode" οnchange = "opCommonHide (this)" class = "ComMode" list = "# request.modeMap" listKey = "key" listValue = "value" value = "# request .mode "> </ S: SELECT>
list Get Map request attribute map in the background as a key value of the drop-down list, the value of the map will be displayed as the pull-down list of values. If you want to set the default values are shown in select multi-mode pass a value for the default selection 

 

Guess you like

Origin www.cnblogs.com/jkfeng/p/12018178.html
009