基于字段值xpages的计算可见属性

时间:2013-01-25 03:42:55

标签: xpages

我是xpages的新手并且在我去的时候试着自学。我试图学习如何根据多值字段是否包含字符串的存在来执行计算的可见属性来隐藏对象。当公式出现时,经典音符会隐藏!@Contains(显示;“SomeValue”)我将如何在xpages SSJS中执行此操作。非常感谢您为新人提供任何帮助。

    <?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core"
    pageTitle="Corporate Policy">
    <xp:table>
        <xp:tr>
            <xp:td rendered="false">

            </xp:td>
            <xp:td>
                <xp:inputText value="#{document1.Display}"
                    id="display">
                </xp:inputText>
            </xp:td>
        </xp:tr>
    </xp:table>
    <xp:br></xp:br>
    <xp:button value="Close" id="button1"
        style="margin-left:5.0px;margin-right:5.0px;margin-bottom:10.0px;margin-top:5.0px">
        <xp:eventHandler event="onclick" submit="true"
            refreshMode="complete" immediate="true" save="false">
        </xp:eventHandler>
    </xp:button>

    <xp:this.data>
        <xp:dominoDocument var="document1" formName="Policy"
            action="openDocument">
        </xp:dominoDocument>
    </xp:this.data>
    <xp:this.navigationRules>
        <xp:navigationRule outcome="xsp-success"
            viewId="/bcbsarequirements.xsp">
        </xp:navigationRule>
    </xp:this.navigationRules>

    <xp:button value="Edit Document" id="button2" style="margin-right:5.0px;margin-bottom:10.0px;margin-top:5.0px"><xp:eventHandler event="onclick" submit="true" refreshMode="complete">
    <xp:this.action>
        <xp:changeDocumentMode mode="autoEdit" var="document1"></xp:changeDocumentMode>
    </xp:this.action></xp:eventHandler></xp:button>
    <xp:panel style="height:auto;padding-left:5.0px;padding-right:5.0px;width:auto;padding-top:5.0px">
        <xp:panel
            style="background-color:rgb(192,192,192);text-align:center;font-weight:bold;font-size:12pt;font-style:italic;width:100%;height:25px;padding-top:3.0px;border-color:rgb(0,0,0);border-style:solid;border-width:medium">
            Corporate Policy
        </xp:panel>
        <xp:panel style="height:auto;border-color:rgb(128,128,128);width:100%;border-style:solid;margin-top:5.0px">
            <xp:table style="width:98%">
                <xp:tr>
                    <xp:td
                        style="border-color:rgb(192,192,192);border-style:dotted;border-width:thin;background-color:rgb(233,233,233);width:121.0px">
                        <xp:label value="Policy Name:" id="name_Label1"
                            for="name1" style="width:80.0px;font-weight:bold">
                        </xp:label>
                    </xp:td>
                    <xp:td
                        style="border-color:rgb(192,192,192);border-style:dotted;border-width:thin;width:210.0px">
                        <xp:inputText value="#{document1.Name}"
                            id="name1">
                        </xp:inputText>
                    </xp:td>
                    <xp:td style="width:16.0px"></xp:td>
                    <td style="width:148.0px;background-color:rgb(233,233,233);border-color:rgb(192,192,192);border-style:dotted;border-width:thin;font-weight:bold">
                        <xp:label value="Policy Number" id="nbr_Label1"
                            for="nbr1" style="width:99.0px">
                        </xp:label>
                    </td>
                    <td style="width:234.0px">
                        <xp:inputText value="#{document1.Nbr}"
                            id="nbr1">
                        </xp:inputText>
                    </td>
                </xp:tr>
                <xp:tr>
                    <xp:td
                        style="background-color:rgb(233,233,233);width:121.0px;border-color:rgb(192,192,192);border-style:dotted;border-width:thin">
                        <xp:label value="Effective Date:"
                            id="effectiveDate_Label1" for="effectiveDate1"
                            style="font-weight:bold">
                        </xp:label>
                    </xp:td>
                    <xp:td style="width:210.0px;border-color:rgb(192,192,192);border-style:dotted;border-width:thin">
                        <xp:inputText value="#{document1.EffectiveDate}"
                            id="effectiveDate1">
                        </xp:inputText>
                    </xp:td>
                    <xp:td style="width:16.0px"></xp:td>
                    <td style="width:148.0px;background-color:rgb(233,233,233);border-color:rgb(192,192,192);border-style:dotted;border-width:thin;font-weight:bold">
                        <xp:label value="Policy Owner:"
                            id="respParty_Label1" for="respParty1">
                        </xp:label>
                    </td>
                    <td style="width:234.0px;border-color:rgb(192,192,192);border-style:dotted;border-width:thin">
                        <xp:inputText value="#{document1.RespParty}"
                            id="respParty1">
                        </xp:inputText>
                    </td>
                </xp:tr>
                <xp:tr>
                    <xp:td
                        style="background-color:rgb(233,233,233);width:121.0px;border-color:rgb(192,192,192);border-style:dotted;border-width:thin">
                        <xp:label value="Revision Date:"
                            id="revisionDate_Label1" for="revisionDate1"
                            style="font-weight:bold">
                        </xp:label>
                    </xp:td>
                    <xp:td style="width:210.0px;border-color:rgb(192,192,192);border-style:dotted;border-width:thin">
                        <xp:inputText value="#{document1.RevisionDate}"
                            id="revisionDate1">
                        </xp:inputText>
                    </xp:td>
                    <xp:td style="width:16.0px"></xp:td>
                    <td style="width:148.0px;background-color:rgb(233,233,233);border-color:rgb(192,192,192);border-style:dotted;border-width:thin;font-weight:bold">
                        <xp:label value="Executive Sponsor"
                            id="execSp_Label1" for="execSp1">
                        </xp:label>
                    </td>
                    <td style="width:234.0px;border-color:rgb(192,192,192);border-style:dotted;border-width:thin">
                        <xp:inputText value="#{document1.ExecSp}"
                            id="execSp1">
                        </xp:inputText>
                    </td>
                </xp:tr>
                <xp:tr>
                    <xp:td style="width:121.0px;background-color:rgb(233,233,233);border-color:rgb(192,192,192);border-style:dotted;border-width:thin">
                        <xp:label value="Category:" id="category_Label1"
                            for="category1" style="font-weight:bold">
                        </xp:label>
                    </xp:td>
                    <xp:td style="width:210.0px;border-color:rgb(192,192,192);border-style:dotted;border-width:thin">
                        <xp:inputText value="#{document1.Category}"
                            id="category1">
                        </xp:inputText>
                    </xp:td>
                    <xp:td style="width:16.0px"></xp:td>
                    <td style="width:148.0px;background-color:rgb(233,233,233);border-color:rgb(192,192,192);border-style:dotted;border-width:thin;font-weight:bold">
                        <xp:label value="Committee Approval Date:"
                            id="cmApprDate_Label1" for="cmApprDate1">
                        </xp:label>
                    </td>
                    <td style="width:234.0px;border-color:rgb(192,192,192);border-style:dotted;border-width:thin">
                        <xp:inputText value="#{document1.CmApprDate}"
                            id="cmApprDate1">
                        </xp:inputText>
                    </td>
                </xp:tr>
                <xp:tr>
                    <xp:td style="width:121.0px;background-color:rgb(233,233,233);border-color:rgb(192,192,192);border-style:dotted;border-width:thin">
                        <xp:label value="Sub Category:"
                            id="subCategory_Label1" for="subCategory1" style="font-weight:bold">
                        </xp:label>
                    </xp:td>
                    <xp:td style="width:210.0px;border-color:rgb(192,192,192);border-style:dotted;border-width:thin">
                        <xp:inputText value="#{document1.SubCategory}"
                            id="subCategory1">
                        </xp:inputText>
                    </xp:td>
                    <xp:td style="width:16.0px"></xp:td>
                    <td style="width:148.0px;background-color:rgb(233,233,233);border-color:rgb(192,192,192);border-style:dotted;border-width:thin;font-weight:bold">
                        <xp:label value="Last Reviewed Date:"
                            id="lastRevDt_Label1" for="lastRevDt1">
                        </xp:label>
                    </td>
                    <td style="width:234.0px;border-color:rgb(192,192,192);border-style:dotted;border-width:thin">
                        <xp:inputText value="#{document1.LastRevDt}"
                            id="lastRevDt1">
                        </xp:inputText>
                    </td>
                </xp:tr>
                <xp:tr>
                    <xp:td style="width:121.0px;border-color:rgb(192,192,192);border-style:dotted;border-width:thin;background-color:rgb(233,233,233)">
                        <xp:label value="Policy Status:"
                            id="polStatus_Label1" for="polStatus1" style="font-weight:bold">
                        </xp:label>
                    </xp:td>
                    <xp:td style="width:210.0px;border-color:rgb(192,192,192);border-style:dotted;border-width:thin">
                        <xp:inputText value="#{document1.PolStatus}"
                            id="polStatus1">
                        </xp:inputText>
                    </xp:td>
                    <xp:td style="width:16.0px"></xp:td>
                    <td style="width:148.0px;background-color:rgb(233,233,233);border-color:rgb(192,192,192);border-style:dotted;border-width:thin;font-weight:bold">
                        <xp:label value="Review Frequency:"
                            id="reviewFreq_Label1" for="reviewFreq1">
                        </xp:label>
                    </td>
                    <td style="width:234.0px;border-color:rgb(192,192,192);border-style:dotted;border-width:thin">
                        <xp:inputText value="#{document1.ReviewFreq}"
                            id="reviewFreq1">
                        </xp:inputText>
                    </td>
                </xp:tr>
                <xp:tr>
                    <xp:td style="width:121.0px;background-color:rgb(233,233,233);border-color:rgb(192,192,192);border-style:dotted;border-width:thin">
                        <xp:label value="Inactive Date:"
                            id="inactDate_Label1" for="inactDate1" style="font-weight:bold">
                        </xp:label>
                    </xp:td>
                    <xp:td style="width:210.0px;border-color:rgb(192,192,192);border-style:dotted;border-width:thin">
                        <xp:inputText value="#{document1.InactDate}"
                            id="inactDate1">
                        </xp:inputText>
                    </xp:td>
                    <xp:td style="width:16.0px"></xp:td>
                    <td style="width:148.0px;background-color:rgb(233,233,233);border-color:rgb(192,192,192);border-style:dotted;border-width:thin;font-weight:bold">
                        <xp:label value="Policy Owner E-mail Address:"
                            id="respEmail_Label1" for="respEmail1">
                        </xp:label>
                    </td>
                    <td style="width:234.0px;border-color:rgb(192,192,192);border-style:dotted;border-width:thin">
                        <xp:inputText value="#{document1.RespEmail}"
                            id="respEmail1">
                        </xp:inputText>
                    </td>
                </xp:tr>







            </xp:table>
            <xp:br></xp:br>
            <xp:table style="width:99.0%;padding-left:5.0px;padding-right:5.0px">
                <xp:tr>

                    <xp:td style="width:718.0px">
                        <xp:label value="Policy Statement:"
                            id="polStmt_Label1" for="polStmt1"
                            style="font-size:10pt;font-weight:bold;color:rgb(0,0,128)">
                        </xp:label>
                    </xp:td>
                </xp:tr>
                <tr>
                    <xp:td style="padding-left:15.0px;padding-right:15.0px;border-color:rgb(192,192,192);border-style:solid;border-width:thin;padding-top:2.0px;padding-bottom:2.0px">
                        <xp:inputRichText value="#{document1.PolStmt}"
                            id="polStmt1" style="width:98%;height:auto">
                        </xp:inputRichText>
                    </xp:td>
                </tr>
                <tr>
                    <xp:td>
                        <xp:label value="Policy Rationale:"
                            id="polRat_Label1" for="polRat1"
                            style="color:rgb(0,0,128);font-weight:bold;font-size:10pt">
                        </xp:label>
                    </xp:td>
                </tr>
                <tr>
                    <xp:td style="padding-left:15.0px;border-color:rgb(192,192,192);border-style:solid;border-width:thin;padding-right:15.0px;padding-top:2.0px;padding-bottom:0.0px">
                        <xp:inputRichText value="#{document1.PolRat}"
                            id="polRat1" style="width:98.0%">
                        </xp:inputRichText>
                    </xp:td>
                </tr>
                <tr>
                    <xp:td>
                        <xp:label value="Policy Scope:"
                            id="polScope_Label1" for="polScope1"
                            style="font-size:10pt;color:rgb(0,0,128);font-weight:bold">
                        </xp:label>
                    </xp:td>
                </tr>
                <tr>
                    <xp:td style="border-color:rgb(192,192,192);border-style:solid;border-width:thin;padding-left:15.0px;padding-right:15.0px">
                        <xp:inputRichText value="#{document1.PolScope}"
                            id="polScope1" style="width:98.0%;height:auto">
                        </xp:inputRichText>
                    </xp:td>
                </tr>
                <tr>
                    <xp:td>
                        <xp:label value="Policy Guide:"
                            id="polGuide_Label1" for="polGuide1"
                            style="color:rgb(0,0,128);font-size:10pt;font-weight:bold">
                        </xp:label>
                    </xp:td>
                </tr>
                <tr>
                    <xp:td style="padding-left:15.0px;padding-right:15.0px;border-color:rgb(192,192,192);border-style:solid;border-width:thin">
                        <xp:inputRichText value="#{document1.PolGuide}"
                            id="polGuide1" style="width:98.0%;height:auto">
                        </xp:inputRichText>
                    </xp:td>
                </tr>
                <tr>
                    <xp:td>
                        <xp:label value="Associated Procedures:"
                            id="polProc_Label1" for="polProc1"
                            style="color:rgb(0,0,128);font-size:10pt;font-weight:bold">
                        </xp:label>
                    </xp:td>
                </tr>
                <tr>
                    <xp:td style="padding-left:15.0px;padding-right:15.0px;border-color:rgb(192,192,192);border-style:solid;border-width:thin">
                        <xp:inputRichText value="#{document1.PolProc}"
                            id="polProc1" style="width:98%;height:auto">
                        </xp:inputRichText>
                    </xp:td>
                </tr>
                <tr>
                    <xp:td>
                        <xp:label value="Monitoring:" id="polMon_Label1"
                            for="polMon1"
                            style="color:rgb(0,0,128);font-size:10pt;font-weight:bold">
                        </xp:label>
                    </xp:td>
                </tr>
                <tr>
                    <xp:td style="padding-left:15.0px;padding-right:15.0px;border-color:rgb(192,192,192);border-style:solid;border-width:thin">
                        <xp:inputRichText value="#{document1.PolMon}"
                            id="polMon1" style="width:98%;height:auto">
                        </xp:inputRichText>
                    </xp:td>
                </tr>
                <tr>
                    <xp:td>
                        <xp:label value="Definitions:"
                            id="polDef_Label1" for="polDef1"
                            style="color:rgb(0,0,128);font-size:10pt;font-weight:bold">
                        </xp:label>
                    </xp:td>
                </tr>
                <tr>
                    <xp:td style="padding-left:15.0px;padding-right:15.0px;border-color:rgb(192,192,192);border-style:solid;border-width:thin">
                        <xp:inputRichText value="#{document1.PolDef}"
                            id="polDef1" style="height:auto;width:98.0%">
                        </xp:inputRichText>
                    </xp:td>
                </tr>
                <tr>
                    <xp:td>
                        <xp:label id="polDef_Label2" for="polDef2"
                            style="color:rgb(0,0,128);font-size:10pt;font-weight:bold">
                            <xp:this.value><![CDATA[Links & References:]]></xp:this.value>
                        </xp:label>
                    </xp:td>
                </tr>
                <tr>
                    <xp:td style="padding-left:15.0px;padding-right:15.0px;border-color:rgb(192,192,192);border-style:solid;border-width:thin">
                        <xp:inputRichText value="#{document1.PolDef}"
                            id="polDef2" style="width:98%;height:auto">
                        </xp:inputRichText>
                    </xp:td>
                </tr>
                <tr>
                    <xp:td>

                        <xp:label value="Relevant Governance Standards:"
                            id="polStds_Label1" for="polStds1"
                            style="font-size:10pt;color:rgb(0,0,128);font-weight:bold">

                        <xp:this.rendered><![CDATA[#{javascript:!@Contains(getComponent("display").getValue(), "RGStandards")}]]></xp:this.rendered></xp:label>
                    </xp:td>
                </tr>
                <tr>
                    <xp:td
                        style="padding-left:15.0px;padding-right:15.0px;border-color:rgb(192,192,192);border-style:solid;border-width:thin">

                        <xp:inputRichText value="#{document1.PolStds}"
                            id="polStds1" style="height:auto;width:98%">

                        </xp:inputRichText>
                    </xp:td>
                </tr>











            </xp:table>
        </xp:panel>
    </xp:panel>
</xp:view>

例如,这些值 “理由” “AssocProc” “定义” “链接”

1 个答案:

答案 0 :(得分:1)

@Contains(getComponent("Display").getValue(), "SomeValue")