thymeleaf单选回显,多选回显,选回显,下拉默认选中第一个
//默认选中第一个
<input type ="radio" name="repaymentType"
th:each ="repaymentType,repaymentState:${repaymentTypeList}"
th:value="${repaymentType.dictName}"
th:text ="${repaymentType.dictName}"
th:attr ="checked=${repaymentState.index==0?true:false}">
//单选回显
<input type="radio" name="repaymentType"
th:each ="repaymentType:${repaymentTypeList}"
th:value="${repaymentType.dictName}"
th:text ="${repaymentType.dictName}"
th:attr ="checked=${financeProductDO.repaymentType == repaymentType.dictName?true:false}">
//多选回显
<input type ="checkbox" name="companyRole"
th:each ="role : ${companyRoleList}"
th:value="${role.dictName}"
th:text ="${role.dictName}"
th:attr ="checked=${companyInformation.companyRole.contains(role.dictName)?true:false}">
//下拉选回显默认选中 前台接收到参数:user对象和businessList集合
<option th:selected="${user.businessId eq busi.businessId}"
th:each="busi:${businessList}"
th:value="${busi.businessId}"
th:text="${busi.businessName}" >
</option>
thymeleaf单选回显,多选回显,选回显,下拉默认选中第一个的更多相关文章
- js怎么能取得多选下拉框选中的多个值?
方法:获取多选下拉框对象数组→循环判断option选项的selected属性(true为选中,false为未选中)→使用value属性取出选中项的值.实例演示如下: 1.HTML结构 1 2 3 4 ...
- selenium选错弹出层的下拉框
要先选中这个弹出层的form元素,再找下拉框 public void downSelectBox(){ driver.get("https://www.imooc.com/user/setp ...
- jquery--获取多选框的值、获取下拉多选框的值
获取多选框的值 var packageCodeList=new Array(); $('#server_id:checked').each(function(){ packageCodeList.pu ...
- 前端组件:支持多选,支持选项筛选的下拉框选择器(基于Jquery和Bootstrap)
效果图一:多选 效果图二:选项筛选 最后奉献源码,复制出来直接可用 <!DOCTYPE html> <html> <head> <meta charset=& ...
- checkbox勾选事件,JQ设置css,下拉框JQ选中
<input id="CheckMainCompany" type="checkbox"/> $(function() { $("#Che ...
- js 判断 undefined,单选 以及下拉框选中状态
name = $(this).attr("title"); if(typeof(name) == 'undefined'){ alert(1); } typeof 函数 radio ...
- VUE 单选下拉框Select中动态加载 默认选中第一个
<lable>分类情况</lable> <select v-model="content.tid"> <option v-for=&quo ...
- thymeleaf下拉框从后台动态获取集合数据并回显选中
今天遇到从后台集合中取出对象在前台页面下拉列表展示: <select name="signature" lay-search="" class=" ...
- layui下拉框渲染问题,以及回显问题
最近实习公司给的新人练手项目用的layui,layui之前自己也接触过但是也就是用了用table组件,没有用过layer弹层这些东西,所以就了解了一下. 首先遇到的一个问题就是下拉框没有样式,然后加样 ...
随机推荐
- HTML--备忘点
1.文档内的链接
- razor表单验证
1.验证注解(Model) public class Student { //默认不能为空 [Required(ErrorMessage ="姓名不能为空")] [StringLe ...
- 结合IL和Windbg来看.Net调用继承虚方法的执行顺序
先上测试代码: using System; using System.Collections.Generic; using System.Linq; using System.Text; using ...
- Spring课程 Spring入门篇 4-1 Spring bean装配(下)之bean定义及作用域注解实现
课程链接: 1 概述 2 代码演练 3 代码解析 1 概述 1.1 bean注解相关 a context:component-scan标签使用 问:该标签的作用是什么? 答:该标签作用是支持注解,在x ...
- 如何在Chrome粘贴图片直接上传
背景 截图或页面复制图片,可以直接通过Ctrl+v 粘贴上传图片 原理 操作:复制(截图)=>粘贴=>上传 监听粘贴事件=>获取剪贴板里的内容=>发请求上传 浏览器:Chrom ...
- CSS列表(新闻列表、导航条)常见写法
以下面这个UL做演示 <ul> <li><a href="#"><span>2014-4-1</span>教育</ ...
- jQuery 判断文本输入框的事件
1.实现以下需求: 输入框中输入内容,发表按钮变为蓝色背景,删除为空则变为原来的颜色 代码实现:通过判断event.target.value是否为空 2.input事件:文本输入框正在输入时生效 f ...
- canvas的isPoinInPath API实现交互
- hibernate 模拟实现和What is and Why O/R Mapping
What is and Why O/R Mapping What is : 用面向对象的方式调用api,类库帮我们翻译成面向关系的方式. Why: 1.JDBC操作数据库很繁琐2.Sql 语句编写并不 ...
- OpenCart-2.3 (Ubuntu 16.04)
平台: Ubuntu 类型: 虚拟机镜像 软件包: opencart-2.3 commercial ecommerce opencart open-source 服务优惠价: 按服务商许可协议 云 ...