freemarker ftl 文件中写radio单选框select 下拉框并且带if条件判断
2011-09-15 14:34
966 查看
<#list themes as t>
<#switch t.id>
<#case "default">
<input name="console-options-theme-menu" type="radio" <#if t.selected> checked </#if> value="${t.id}">蓝色主题
<#break>
<#case "gdocs">
<input name="console-options-theme-menu" type="radio" <#if t.selected> checked </#if> value="${t.id}">淡蓝主题
<#break>
<#case "greenTheme">
<input name="console-options-theme-menu" type="radio" <#if t.selected> checked </#if> value="${t.id}">绿色主题
<#break>
<#case "hcBlack">
<input name="console-options-theme-menu" type="radio" <#if t.selected> checked </#if> value="${t.id}">黑色主题
<#break>
<#case "yellowTheme">
<input name="console-options-theme-menu" type="radio" <#if t.selected> checked </#if> value="${t.id}">***主题
<#break>
<#default>
<input name="console-options-theme-menu" type="radio" <#if t.selected> checked </#if> value="${t.id}">${t.title?html}${t.id?html}1
</#switch>
</#list>
下拉框
<select id="console-options-theme-menu">
<#list themes as t>
<#switch t.id>
<#case "default">
<option value="${t.id}"<#if t.selected> selected="selected"</#if>>蓝色主题</option>
<#break>
<#case "gdocs">
<option value="${t.id}"<#if t.selected> selected="selected"</#if>>淡蓝主题</option>
<#break>
<#case "greenTheme">
<option value="${t.id}"<#if t.selected> selected="selected"</#if>>绿色主题</option>
<#break>
<#case "hcBlack">
<option value="${t.id}"<#if t.selected> selected="selected"</#if>>黑色主题</option>
<#break>
<#case "yellowTheme">
<option value="${t.id}"<#if t.selected> selected="selected"</#if>>***主题</option>
<#break>
<#default>
<option value="${t.id}"<#if t.selected> selected="selected"</#if>>${t.title?html}${t.id?html}1</option>
</#switch>
</#list>
</select>
<#switch t.id>
<#case "default">
<input name="console-options-theme-menu" type="radio" <#if t.selected> checked </#if> value="${t.id}">蓝色主题
<#break>
<#case "gdocs">
<input name="console-options-theme-menu" type="radio" <#if t.selected> checked </#if> value="${t.id}">淡蓝主题
<#break>
<#case "greenTheme">
<input name="console-options-theme-menu" type="radio" <#if t.selected> checked </#if> value="${t.id}">绿色主题
<#break>
<#case "hcBlack">
<input name="console-options-theme-menu" type="radio" <#if t.selected> checked </#if> value="${t.id}">黑色主题
<#break>
<#case "yellowTheme">
<input name="console-options-theme-menu" type="radio" <#if t.selected> checked </#if> value="${t.id}">***主题
<#break>
<#default>
<input name="console-options-theme-menu" type="radio" <#if t.selected> checked </#if> value="${t.id}">${t.title?html}${t.id?html}1
</#switch>
</#list>
下拉框
<select id="console-options-theme-menu">
<#list themes as t>
<#switch t.id>
<#case "default">
<option value="${t.id}"<#if t.selected> selected="selected"</#if>>蓝色主题</option>
<#break>
<#case "gdocs">
<option value="${t.id}"<#if t.selected> selected="selected"</#if>>淡蓝主题</option>
<#break>
<#case "greenTheme">
<option value="${t.id}"<#if t.selected> selected="selected"</#if>>绿色主题</option>
<#break>
<#case "hcBlack">
<option value="${t.id}"<#if t.selected> selected="selected"</#if>>黑色主题</option>
<#break>
<#case "yellowTheme">
<option value="${t.id}"<#if t.selected> selected="selected"</#if>>***主题</option>
<#break>
<#default>
<option value="${t.id}"<#if t.selected> selected="selected"</#if>>${t.title?html}${t.id?html}1</option>
</#switch>
</#list>
</select>
相关文章推荐
- 26_Shell语言――――if条件判断之文件测试、短路操作符
- mybatis **-mapping.xml文件中if test表达式逻辑判断“并且”,不能用&&
- shell if条件中判断文件或字符操作
- 条件判断之if、case语句和文件查找命令
- mybatis **-mapping.xml文件中if test表达式逻辑判断“并且”,不能用&&
- 草泥马的Shell if 条件判断 如果 == 左右没有空格,不会报错并且按照True来执行。草泥马的
- shell if 条件判断 文件 文件夹 链接
- JQuery_JavaScript___select、radio、checkbox下拉框,单选框,复选框操作
- Struts2中的ognl标签介绍(property标签、iterator标签、if/elseif/else标签、url标签、url标签、radio单选框、select下拉选择框)
- mybatis **-mapping.xml文件中if test表达式逻辑判断“并且”,不能用&&
- mybatis **-mapping.xml文件中if test表达式逻辑判断“并且”,不能用&&
- Vue.js 中v-for和v-if一起使用,来判断select中的option为选中项
- 为什么喜欢在 if() 条件判断中使用逗号操作符?
- 条件判断语句:文件、数值、字符串
- 《iOS移动开发从入门到精通》图书连载14: if条件判断语句、switch条件判断语句、 continue语句和forthrough语句
- Swift if条件判断
- <s:if test="">标签以动态数据为判断条件
- shell 中的条件判断 “并且” “或者”
- Linuxshell脚本之if条件判断
- 1.2shell逻辑判断、文件属性判断、if特殊用法、case判断