使用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"
属性,该属性从html中删除了消息和标签
根据Trinidad API for selectBooleanCheckbox
。
新代码:
<tr:selectBooleanCheckbox text="FIRST" id="firstType" value="#{bean.type}" simple="true"/>