我曾经使用c:if,c:当jsp中的JSTL标签。但是我不知道是否有类似的东西可用于视觉页面。举个例子,我正在为jsp提供示例代码。 -if-else visualforce中的条件块
<h1>A Demo conditional section code</h1>
<c:choose>
<c:when test="${param.colorField == 'red'}">
<table border="0" width="150" height="50" bgcolor="#ff0000">
<tr><td>It is red</td></tr>
</table>
</c:when>
<c:when test="${param.colorField == 'blue'}">
<table border="0" width="150" height="50" bgcolor="#0000ff">
<tr><td>It is blue</td></tr>
</table>
</c:when>
<c:when test="${param.colorField == 'green'}">
<table border="0" width="150" height="50" bgcolor="#00ff00">
<tr><td>Green table</td></tr>
</table>
</c:when>
<c:otherwise>
<table border="0" width="150" height="50" bgcolor="#000000">
<tr><td>No colour changed</td></tr>
</table>
</c:otherwise>
</c:choose>
<br/>
and other codes....
我在vf页面中缺少这种页面块准备。
好的。在这种情况下,我提供的样本太简单了,不能说明我想提到的复杂性。说一个条件,我想以表格的形式显示一组数据。否则,我会打印一个段落。那又怎么样?我想很多包含HTML标记和价值观等 – 2015-04-07 06:28:30
对于开关的代码块一个代码块,你可以使用渲染属性附加伤害 <顶点之间切换:outputPanel渲染=“{工资<=0}"> ... 顶点:ouputPanel > 0}”> ... apex:ouputPanel> –
nickzenko
2015-04-07 06:48:05