OR条件的 Tapestry 或 JSP

huangapple go评论68阅读模式
英文:

Tapestry or JSP - OR condition

问题

如果jwcid是isNotFSCisFSCIP中的一个,则需要显示该字段。

在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">

huangapple
  • 本文由 发表于 2023年6月16日 04:30:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/76485317.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定