0

我是 Apache 新手OFBiz,想自定义一些表单,我有以下代码,我想仅为当前用户记录显示超链接,而对于其他用户记录,当前用户不应该看到超链接,而只是看到文本。

 <form name="ListEmplPositions" type="list" separate-columns="true" default-entity-name="EmplPosition" list-name="listIt" paginate-target="FindEmplPositions" paginate="true"
    odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
    <actions>
        <service service-name="performFind" result-map="result" result-map-list="listIt">
            <field-map field-name="inputFields" from-field="parameters"/>
            <field-map field-name="entityName" value="EmplPosition"/>
            <field-map field-name="orderBy" value="emplPositionId"/>
            <field-map field-name="viewIndex" from-field="viewIndex"/>
            <field-map field-name="viewSize" from-field="viewSize"/>
        </service>
    </actions>
    <auto-fields-entity entity-name="EmplPosition" default-field-type="display"/>
    <field use-when="emplPositionId==userLogin.partyId" name="emplPositionId" title="${uiLabelMap.HumanResEmployeePositionId}" widget-style="linktext">
        <hyperlink also-hidden="false" description="${emplPositionId}" target="emplPositionView">
            <parameter param-name="emplPositionId"/>
        </hyperlink>
    </field>
</form>

我希望字段“empPositionId”的最后几行中的超链接仅对当前用户记录启用。我尝试使用和其他条件,但没有奏效,任何想法,将不胜感激。

4

1 回答 1

1

使用 bsh 条件如下,

<field use-when="${bsh:emplPositionId==userLogin.partyId}" name="emplPositionId" title="${uiLabelMap.HumanResEmployeePositionId}" widget-style="linktext">
    <hyperlink also-hidden="false" description="${emplPositionId}" target="emplPositionView">
        <parameter param-name="emplPositionId"/>
    </hyperlink>
</field>
于 2014-01-29T09:52:12.723 回答