jsf中标签使用时遇到的一个小问题

由于jsf中标签都是使用id来识别的,因此在jsf中标签最好给id取一个名字,否则很可能会出现一些问题
比如:下面这段程序
<td>
<c:if test="${FLAG}">
<h:commandButton id="dfdf" value="#{msg['unsalable.save.approve']}" action=""></h:commandButton>
<h:commandButton id="ddd" value="#{msg['unsalable.cancel.buhuo']}" action=""></h:commandButton>
</c:if>
<c:if test="${!FLAG}">
<h:commandButton id="ff" value="#{msg['unsalable.out.addPage.cancel']}"></h:commandButton>
</c:if>
</td>

如果第一个按钮的id和第三个按钮的id没有标识,那么
<c:if test="${!FLAG}">
<h:commandButton id="ff" value="#{msg['unsalable.out.addPage.cancel']}"></h:commandButton>
</c:if>

显示后再显示
<c:if test="${FLAG}">
<h:commandButton id="dfdf" value="#{msg['unsalable.save.approve']}" action=""></h:commandButton>
<h:commandButton id="ddd" value="#{msg['unsalable.cancel.buhuo']}" action=""></h:commandButton>
</c:if>
那么第一个按钮显示的值就会和第三个按钮显示的值一样,不会按照你自己的定义的标签显示
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值