使用struts2 checkboxlist標(biāo)簽設(shè)置cssClass屬性后,發(fā)現(xiàn)生成的html代碼中 input 標(biāo)簽并沒有class屬性。
打開checkboxlist.ftl看,內(nèi)容如下:
<input type="checkbox" name="${parameters.name?html}" value="${itemKeyStr?html}" id="${parameters.name?html}-${itemCount}"<#rt/>
<#if tag.contains(parameters.nameValue, itemKey)>
checked="checked"<#rt/>
</#if>
<#if parameters.disabled?default(false)>
disabled="disabled"<#rt/>
</#if>
<#if parameters.title??>
title="${parameters.title?html}"<#rt/>
</#if>
<#include "/${parameters.templateDir}/simple/scripting-events.ftl" />
<#include "/${parameters.templateDir}/simple/common-attributes.ftl" />
/>
根本沒有cssClass參數(shù)進(jìn)行設(shè)置。
添加下面的內(nèi)容,在替換struts2包中的
checkboxlist.ftl
文件就可以了:
鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請第一時間聯(lián)系我們修改或刪除,多謝。
新聞熱點(diǎn)
疑難解答