form:checkboxes radiobutton select用法
<form:checkboxes path="subjects" items="${requestScope.subjects}" element="label class='checkbox-inline'" itemLabel="name" itemValue="id"/><br/>
生成的代码
<label class="checkbox-inline"><input id="subjects1" name="subjects" type="checkbox" value="8"><label for="subjects1">测试</label></label>
<form:radiobuttons path="receive.accType.id"
element="label class='radio' <span style="color:#3366FF;">style='margin-right:4px;'</span>"
items="${accTypes }" itemLabel="name" itemValue="id"/>
<form:checkboxes element="label class='checkbox' <span style="color:#3333FF;">style='margin-right:10px;'</span>"
items="${accNature }" path="accNature"
itemLabel="name" itemValue="id"/>
<form:radiobutton path="arriveway" value="1" checked="true"/>安吉汽车站 
<form:radiobuttons path="leaderId"
items="${requestScope.subject.users }" element="label class='radio'" itemLabel="name"
itemValue="id" />
参考:
Spring MVC框架checkboxes标签的三种使用方式
Spring form 学习之(一)--radiobuttons & checkboxes样式
select
<form:select class="form-control" path="subject.id" items="${requestScope.subjects}" itemLabel="name"
itemValue="id"></form:select>生诚的html代码<select id="subject.id" name="subject.id" class="form-control"><option value="1" selected="selected">英语</option><option value="2">数学</option><option value="3">语文</option></select>
后台取数据@RequestParam(value="subject.id", required=false) Integer subjectId
protected Map referenceData(HttpServletRequest request) throws Exception {
Map referenceData = new HashMap();
Map<String,String> country = new LinkedHashMap<String,String>();
country.put("US", "United Stated");
country.put("CHINA", "China");
country.put("SG", "Singapore");
country.put("MY", "Malaysia");
referenceData.put("countryList", country);
}
<form:select path="country" items="${countryList}" />
<form:select path="country">
<form:options items="${countryList}" />
</form:select>
2. <form:options />
The <form:options /> have to enclosed with the select tag.
<form:select path="country">
<form:options items="${countryList}" />
</form:select>
HTML code
<select id="country" name="country">
<option value="US">United Stated</option>
<option value="CHINA">China</option>
<option value="SG">Singapore</option>
<option value="MY">Malaysia</option>
</select>
3. <form:option />
The <form:option /> have to enclosed with the select tag as well, and render a single select option, see the following combination.
<form:select path="country">
<form:option value="NONE" label="--- Select ---"/>
<form:options items="${countryList}" />
</form:select>
HTML code
<select id="country" name="country">
<option value="NONE">--- Select ---</option>
<option value="US">United Stated</option>
<option value="CHINA">China</option>
<option value="SG">Singapore</option>
<option value="MY">Malaysia</option>
</select>
4. List box
To render a list box, just add the “multiple=true” attribute in the select tag.
<form:select path="country" items="${countryList}" multiple="true" />
HTML code, with a hidden value to handle the country selections.
<select id="country" name="country" multiple="multiple">
<option value="US">United Stated</option>
<option value="CHINA">China</option>
<option value="SG">Singapore</option>
<option value="MY">Malaysia</option>
</select>
<input type="hidden" name="_country" value="1"/>
form:checkboxes radiobutton select用法的更多相关文章
- C#中 Request, Request.params , Request.querystring , Request.Form 区别 与联系用法
C#中 Request, Request.params , Request.querystring , Request.Form 区别 与联系用法? Request.params , Request ...
- spring <form:checkboxes> tag and css class
I have issue with: <form:checkboxes path="roles" cssClass="checkbox" items=&q ...
- how to make form:checkboxes in JSP
retransmitTable.jsp file: <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix=&qu ...
- html select用法总结
本文将介绍select 原生的常用方法,这些都是经过测试,兼容ie6到ie10,及chrome,火狐等,也就是说大部分浏览器都兼容.如果大家发现有不兼容的情况,可以跟我留言. 我们对基本的用法了如指掌 ...
- 网络通信 --> select()用法
select()用法 头文件 #include <sys/time.h> #include <sys/types.h> #include <unistd.h> 定义 ...
- python+selenium七:下拉框、选项框、select用法
# from selenium import webdriverfrom selenium.webdriver.common.action_chains import ActionChainsimpo ...
- golang学习之select用法
早期的select函数是用来监控一系列的文件句柄,一旦其中一个文件句柄发生IO操作,该select调用就会被返回.golang在语言级别直接支持select,用于处理异步IO问题. select用法同 ...
- 数据库Oracle的select用法(部分)
Oracle的select用法(部分): 1.查询所有: select * from employees; 2.加上where子句:用选择限制行 select * from employees whe ...
- 使用layui的form.on绑定select选中事件, form.on()不执行的原因分析
使用layui的form.on绑定select选中事件中, form.on()不执行, 主要原因有 1, select标签中没有写lay_filter属性,用来监听 <select id=&qu ...
随机推荐
- bootstrap 模式对话框
<!doctype html> <html> <head> <meta charset="utf-8"> <title> ...
- java常用 api
java -cp .:/app/jenkins/ojdbc6-11.2.0.1.0.jar QueryInterTestImpl onclick="add_win.after(initVa ...
- C++获取系统时间方法(毫秒级)
#include <sys/time.h> long getCurrentTime() { struct timeval tv; gettimeofday(&tv,NULL); r ...
- Asp.net中使用文本框的值动态生成控件的方法
这篇文章主要介绍了Asp.net中使用文本框的值动态生成控件的方法,非常不错,具有参考借鉴价值,需要的朋友可以参考下 看到一个网友,有论坛上问及,动态的生成checkbox控件,在文本框中输入一个“花 ...
- 【matlab】生成列是0-255渐变的图像
图像大小:640×512 8位灰度图 %% 生成图像 %大小:* %类型:灰度图 %灰度值:列按照0-255渐变,故命名为column shade. clc,clear all,close all; ...
- EF提供的3中查询方式
1. Linq to Entities using (TestEntities te = new TestEntities()) { var user = from a in te.User wher ...
- C# 中利用反射机制拷贝类的字段和属性(拷贝一个类对象的所有东西付给另一个类对象,而不是付给引用地址)
from:https://blog.csdn.net/poxiaohai2011/article/details/27555951 //C# 中利用反射机制拷贝类的字段和属性(拷贝一个类对象的所有东西 ...
- java-通过 HashMap、HashSet 的源码分析其 Hash 存储机制
通过 HashMap.HashSet 的源码分析其 Hash 存储机制 集合和引用 就像引用类型的数组一样,当我们把 Java 对象放入数组之时,并非真正的把 Java 对象放入数组中.仅仅是把对象的 ...
- android应用安全——组件通信安全(Intent)
这里主要涉及到了Activity.Content Provider.Service.Broadcast Receiver等.这些如果在Androidmanifest.xml配置不当,会被其他应用调用, ...
- Volley使用详细说明
前一篇粗略的介绍了一下Volley,并在最后附上了一段使用代码,这一篇详细的介绍一下Volley的使用.前面也说了Volley主要获取JSON对象和图片加载,这里也分为两部分介绍. 1.获取JSON对 ...