JSF怎样根据判断条件显示不同文本

来源:互联网 发布:linux c 开源项目 编辑:程序博客网 时间:2024/05/29 03:20
Java代码  收藏代码
  1. <h:outputText value="本地邮递"  
  2.                                     rendered="#{signList.ebillmode eq '0'}"></h:outputText>  
  3.                                 <h:outputText value="外地邮寄"  
  4.                                     rendered="#{signList.ebillmode eq '1'}"></h:outputText>  
  5.                                 <h:outputText value="面对面对账"  
  6.                                     rendered="#{signList.ebillmode eq '2'}"></h:outputText>  
   用rendered

dataTable中rendered的使用

<h:dataTable var="filePayTransList" rows="#{requestFileBatchWebPaymentBean.pageSize}"
rendered="#{not empty requestFileBatchWebPaymentBean.filePayTransList}"
width="95%" headerClass="standardTable_Header"
styleClass="table" binding="#{requestFileBatchWebPaymentBean.filePayTransTable}">
<h:column id="payNo">
<f:facet name="header">
<h:outputText escape="false"
value="<div align='center'>文件序号</div>"></h:outputText>
</f:facet>
<h:outputText value="本地邮递" rendered="#{filePayTransList.filePayNo eq requestFileBatchWebPaymentBean.payResultFileNo}"></h:outputText>
</h:column>
</h:dataTable>

原创粉丝点击