当前位置:网站首页>Thymeleaf data echo, single selection backfill, drop-down backfill, time frame backfill
Thymeleaf data echo, single selection backfill, drop-down backfill, time frame backfill
2022-06-26 04:28:00 【good writings make people copy them】
Reprint :https://blog.csdn.net/guochanof/article/details/90734174
input backfill
<div class="form-group">
<label class="col-sm-1 control-label"> Name of customer :</label>
<div class="col-sm-3">
<input id="customerName" name="customerName" th:value="${customer.customerName}" class="form-control" type="text">
</div>
</div>
Single choice backfill
<div class="form-group">
<label class="col-sm-1 col-sm-offset-2 control-label"> Gender :</label>
<div class="col-sm-3">
<label class="radio-inline" th:each="sex:${sexList}">
<input type="radio" id="sex" name="sex" th:value="${sex.value}" th:text="${sex.name}" th:attr="checked=${customer.sex == sex.value?true:false}" />
</label>
</div>
</div>
Time frame backfill
<div class="form-group">
<label class="col-sm-1 control-label"> Date of birth :</label>
<div class="col-sm-3">
<input type="text" class="laydate-icon layer-date form-control" id="birthday" name="birthday" th:value="${customer.birthday}==null?null:${#dates.format(customer.birthday,'yyyy-MM-dd')}" οnclick="laydate({istime: true, format: 'YYYY-MM-DD'})" style="background-color: #fff;" readonly="readonly" />
</div>
</div>
Pull down backfill
<div class="form-group">
<label class="col-sm-1 col-sm-offset-2 control-label"> occupation :</label>
<div class="col-sm-3">
<select data-placeholder="-- Choose a category --" name="profession" id="profession" class="form-control chosen-select" tabindex="2" required>
<option value="">-- Choose a category --</option>
<option th:selected="${customer.profession eq profession.value}" th:each="profession:${professionTypeList}" th:value="${profession.value}" th:text="${profession.name}"></option>
</select>
</div>
</div>
Reprint :https://blog.csdn.net/qq_43639296/article/details/88723128
thymeleaf Of textarea For data echo th:text,th:value Cannot echo
Nonempty judgment of set
th:if="${not #lists.isEmpty( Custom collection )}"
String splicing
<span th:text="|Welcome to home, ${user.name}!|">
// This is actually equivalent to :
<span th:text="'Welcome to home, ' + ${user.name} + '!'">
// Text substitution can be combined with other types of expressions :
<span th:text="${onevar} + ' ' + |${twovar}, ${threevar}|">
decimal ( rounding )
// Show 1.24
th:text="${#numbers.formatDecimal(1.235, 1, 2)}"
a label - Hyperlinks
// Show 1.24
<a th:href="@{/companyUser/getUserByUserName/(id=${companyUser.id},userName=${companyUser.userName})}">view</a>
<a th:href="@{/companyUser/{companyUser.id}/getUserByUserName>view</a>
Ternary operators judge
th:text="'Execution mode is ' + ( ('0'!='0')? 'Development' : 'Production')"
边栏推荐
- Ipvs0 network card of IPVS
- Nailing open platform - applet development practice (nailing applet client)
- 2021-02-07
- 1064 (42000) error occurred when installing MySQL and modifying root password
- Sorting out the examination sites of the 13th Blue Bridge Cup single chip microcomputer objective questions
- 线程同步之互斥量(互斥锁)
- Which is the best embedded visual programming software? (introduction, evaluation and selection of visual programming platform) [scratch, mind+, mixly]
- Simple personal summary of tp6 multi application deployment -- Part I [original]
- Database related knowledge
- How do wechat applets delay? Timing? Execute a piece of code after? (kengji)
猜你喜欢
Sorting out the examination sites of the 13th Blue Bridge Cup single chip microcomputer objective questions
Minecraft 1.16.5 生化8 模组 1.9版本 1.18版本同步
PHP small factory moves bricks for three years - interview series - my programming life
Read / write lock for thread synchronization
Conditional variables for thread synchronization
win10 系统打开的软件太小,如何变大(亲测有效)
钉钉开放平台-小程序开发实战(钉钉小程序客户端)
Zeromq from getting started to mastering
Wechat applet is bound to a dynamic array to implement a custom radio box (after clicking the button, disable the button and enable other buttons)
線程同步之讀寫鎖
随机推荐
Sixtool- source code of multi-functional and all in one generation hanging assistant
The select option in laravel admin contains a large amount of data
Analysis report on the development trend and operation status of China's environmental monitoring instrument industry from 2022 to 2028
SQL related knowledge - constraints
Nailing open platform - applet development practice (nailing applet client)
Alipay failed to verify the signature (sandbox test indicates fishing risk?) [original]
MySQL index details
钉钉开放平台-小程序开发实战(钉钉小程序服务器端)
35 year old programmer fired Luna millions of assets and returned to zero in three days. Netizen: it's the same as gambling
Lua grammar explanation
BSC 及HT 等链的NFT 创造及绑定图片教程
Laravel pay payment access process
Implementation of seven classes of BlockingQueue interface
CTF serialization and deserialization
線程同步之讀寫鎖
NFT creation and binding of BSC and HT chains
Parse JSON interface and insert it into the database in batch
[Qunhui] command line acme SH automatically apply for domain name certificate
Laravel framework Alipay payment fails to receive asynchronous callback request [original]
An unexpected attempt (Imperial CMS list template filters spaces and newlines in smalltext introduction)