[英]JSF Trinidad SelectBooleanCheckbox with out Label
使用Trinidad selectBooleanCheckbox组件,如下所示:
<tr:selectBooleanCheckbox text="FIRST" id="firstType" value="#{bean.type}"/>
渲染html是:
<tr>
<td>
<table cellspacing="0" cellpadding="0" border="0" summary=""
style="padding: 0px" class="af_selectBooleanCheckbox"
id="idtable">
<tbody>
<tr>
<td nowrap="" class="af_selectBooleanCheckbox_label"><span
style="display: none;" id="firstType::icon"><a
class="AFErrorIconStyle" title="Error"
name="_msgAnc_firstType">X</a>
</span>
</td>
<td valign="top" nowrap="" class="AFContentCell">
<span id="firstType__xc_c"
class="af_selectBooleanCheckbox_content"><input
type="checkbox" checked="" value="t" name="first"
id="firstType"><label for="firstType">FIRST</label>
</span>
</td>
</tr>
<tr>
<td></td>
<td class="AFComponentMessageCell">
<span style="margin-left: 21px; padding: 0px"
class="OraInlineErrorText" id="first::msg"></span>
</td>
</tr>
</tbody>
</table>
</td>
我的问题是:
我不使用label,而是使用text属性(因为我想先呈现复选框,然后呈现文本-当我使用标签时,标签显示在复选框之前)
所以我要的是呈现的html根本不会呈现标签的部分,因为它占据了我无法删除的位置。
请协助。
我找到了解决我问题的方法
我只是添加了属性simple="true"
,该属性根据selectBooleanCheckbox
API for selectBooleanCheckbox
从html中删除了消息和标签。
新代码:
<tr:selectBooleanCheckbox text="FIRST" id="firstType" value="#{bean.type}" simple="true"/>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.