英文:
Tapestry or JSP - OR condition
问题
如果jwcid是isNotFSC或isFSCIP中的一个,则需要显示该字段。
在Tapestry或JSP中如何编写OR条件?
英文:
I am new to Tapestry and JSP. How can I write this directive?
If jwcid is either isNotFSC OR isFSCIP, then it needs to display that field.
<tr>
<td class="field-label">Created: </td>
<td><text jwcid="created">00/00/0000</text></td>
<td class="field-label">Created By: </td>
<td><text jwcid="createdBy">Claims project</text> </td>
<if jwcid = "isNotFSC" || jwcid = "isFSCIP">
<td><submit id="startFollowupARequirementTask" jwcid="startFollowupARequirementTask"/></td>
</if>
</tr>
How is the OR condition is written in Tapestry or JSP?
答案1
得分: 1
这里有一个示例,演示了如何使用Tapestry语法编写OR条件:
代码示例:
<tr>
<td class="field-label">创建日期:</td>
<td><text jwcid="created">00/00/0000</text></td>
<td class="field-label">创建者:</td>
<td><text jwcid="createdBy">Claims项目</text></td>
<t:if test="${jwcid == 'isNotFSC' || jwcid == 'isFSCIP'}">
<td><submit id="startFollowupARequirementTask" jwcid="startFollowupARequirementTask"/></td>
</t:if>
</tr>
Tapestry要求你使用t:if
指令,然后在这个指令内部可以使用OR
运算符||
。
此外,请确保在模板文件的开头声明Tapestry命名空间。如果还没有添加,请将以下代码添加到文件顶部:
<html t:type="layout" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_4.xsd">
英文:
Here you have an example of how you can write an OR condition using Tapestry syntax:
Code Example:
<tr>
<td class="field-label">Created:</td>
<td><text jwcid="created">00/00/0000</text></td>
<td class="field-label">Created By:</td>
<td><text jwcid="createdBy">Claims project</text></td>
<t:if test="${jwcid == 'isNotFSC' || jwcid == 'isFSCIP'}">
<td><submit id="startFollowupARequirementTask" jwcid="startFollowupARequirementTask"/></td>
</t:if>
</tr>
Tapestry wants you to use the t:if
directive, and then you can use the OR
operator ||
within this directive.
Also make sure that you have Tapestry namespace declaration at the beginning of your template file.
Just add it to the top of the file if you didn't already:
<html t:type="layout" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_4.xsd">
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论