title: Computed Visible property based on field value xpages
body: <p>I am new to xpages and trying to teach myself as I go along. I am trying to learn how to do a computed visible property to hide an object based on the presence of whether a multi valued field contains a string. The classic notes hide when formula would be !@Contains(Display; "SomeValue") How would I do this in xpages SSJS. Thank you very much for any assistance for a new guy.</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xp:view xmlns:xp="http://www.ibm.com/xsp/core"
      pageTitle="Corporate Policy"&gt;
      &lt;xp:table&gt;
          &lt;xp:tr&gt;
              &lt;xp:td rendered="false"&gt;
  
              &lt;/xp:td&gt;
              &lt;xp:td&gt;
                  &lt;xp:inputText value="#{document1.Display}"
                      id="display"&gt;
                  &lt;/xp:inputText&gt;
              &lt;/xp:td&gt;
          &lt;/xp:tr&gt;
      &lt;/xp:table&gt;
      &lt;xp:br&gt;&lt;/xp:br&gt;
      &lt;xp:button value="Close" id="button1"
          style="margin-left:5.0px;margin-right:5.0px;margin-bottom:10.0px;margin-top:5.0px"&gt;
          &lt;xp:eventHandler event="onclick" submit="true"
              refreshMode="complete" immediate="true" save="false"&gt;
          &lt;/xp:eventHandler&gt;
      &lt;/xp:button&gt;
  
      &lt;xp:this.data&gt;
          &lt;xp:dominoDocument var="document1" formName="Policy"
              action="openDocument"&gt;
          &lt;/xp:dominoDocument&gt;
      &lt;/xp:this.data&gt;
      &lt;xp:this.navigationRules&gt;
          &lt;xp:navigationRule outcome="xsp-success"
              viewId="/bcbsarequirements.xsp"&gt;
          &lt;/xp:navigationRule&gt;
      &lt;/xp:this.navigationRules&gt;
  
      &lt;xp:button value="Edit Document" id="button2" style="margin-right:5.0px;margin-bottom:10.0px;margin-top:5.0px"&gt;&lt;xp:eventHandler event="onclick" submit="true" refreshMode="complete"&gt;
      &lt;xp:this.action&gt;
          &lt;xp:changeDocumentMode mode="autoEdit" var="document1"&gt;&lt;/xp:changeDocumentMode&gt;
      &lt;/xp:this.action&gt;&lt;/xp:eventHandler&gt;&lt;/xp:button&gt;
      &lt;xp:panel style="height:auto;padding-left:5.0px;padding-right:5.0px;width:auto;padding-top:5.0px"&gt;
          &lt;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"&gt;
              Corporate Policy
          &lt;/xp:panel&gt;
          &lt;xp:panel style="height:auto;border-color:rgb(128,128,128);width:100%;border-style:solid;margin-top:5.0px"&gt;
              &lt;xp:table style="width:98%"&gt;
                  &lt;xp:tr&gt;
                      &lt;xp:td
                          style="border-color:rgb(192,192,192);border-style:dotted;border-width:thin;background-color:rgb(233,233,233);width:121.0px"&gt;
                          &lt;xp:label value="Policy Name:" id="name_Label1"
                              for="name1" style="width:80.0px;font-weight:bold"&gt;
                          &lt;/xp:label&gt;
                      &lt;/xp:td&gt;
                      &lt;xp:td
                          style="border-color:rgb(192,192,192);border-style:dotted;border-width:thin;width:210.0px"&gt;
                          &lt;xp:inputText value="#{document1.Name}"
                              id="name1"&gt;
                          &lt;/xp:inputText&gt;
                      &lt;/xp:td&gt;
                      &lt;xp:td style="width:16.0px"&gt;&lt;/xp:td&gt;
                      &lt;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"&gt;
                          &lt;xp:label value="Policy Number" id="nbr_Label1"
                              for="nbr1" style="width:99.0px"&gt;
                          &lt;/xp:label&gt;
                      &lt;/td&gt;
                      &lt;td style="width:234.0px"&gt;
                          &lt;xp:inputText value="#{document1.Nbr}"
                              id="nbr1"&gt;
                          &lt;/xp:inputText&gt;
                      &lt;/td&gt;
                  &lt;/xp:tr&gt;
                  &lt;xp:tr&gt;
                      &lt;xp:td
                          style="background-color:rgb(233,233,233);width:121.0px;border-color:rgb(192,192,192);border-style:dotted;border-width:thin"&gt;
                          &lt;xp:label value="Effective Date:"
                              id="effectiveDate_Label1" for="effectiveDate1"
                              style="font-weight:bold"&gt;
                          &lt;/xp:label&gt;
                      &lt;/xp:td&gt;
                      &lt;xp:td style="width:210.0px;border-color:rgb(192,192,192);border-style:dotted;border-width:thin"&gt;
                          &lt;xp:inputText value="#{document1.EffectiveDate}"
                              id="effectiveDate1"&gt;
                          &lt;/xp:inputText&gt;
                      &lt;/xp:td&gt;
                      &lt;xp:td style="width:16.0px"&gt;&lt;/xp:td&gt;
                      &lt;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"&gt;
                          &lt;xp:label value="Policy Owner:"
                              id="respParty_Label1" for="respParty1"&gt;
                          &lt;/xp:label&gt;
                      &lt;/td&gt;
                      &lt;td style="width:234.0px;border-color:rgb(192,192,192);border-style:dotted;border-width:thin"&gt;
                          &lt;xp:inputText value="#{document1.RespParty}"
                              id="respParty1"&gt;
                          &lt;/xp:inputText&gt;
                      &lt;/td&gt;
                  &lt;/xp:tr&gt;
                  &lt;xp:tr&gt;
                      &lt;xp:td
                          style="background-color:rgb(233,233,233);width:121.0px;border-color:rgb(192,192,192);border-style:dotted;border-width:thin"&gt;
                          &lt;xp:label value="Revision Date:"
                              id="revisionDate_Label1" for="revisionDate1"
                              style="font-weight:bold"&gt;
                          &lt;/xp:label&gt;
                      &lt;/xp:td&gt;
                      &lt;xp:td style="width:210.0px;border-color:rgb(192,192,192);border-style:dotted;border-width:thin"&gt;
                          &lt;xp:inputText value="#{document1.RevisionDate}"
                              id="revisionDate1"&gt;
                          &lt;/xp:inputText&gt;
                      &lt;/xp:td&gt;
                      &lt;xp:td style="width:16.0px"&gt;&lt;/xp:td&gt;
                      &lt;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"&gt;
                          &lt;xp:label value="Executive Sponsor"
                              id="execSp_Label1" for="execSp1"&gt;
                          &lt;/xp:label&gt;
                      &lt;/td&gt;
                      &lt;td style="width:234.0px;border-color:rgb(192,192,192);border-style:dotted;border-width:thin"&gt;
                          &lt;xp:inputText value="#{document1.ExecSp}"
                              id="execSp1"&gt;
                          &lt;/xp:inputText&gt;
                      &lt;/td&gt;
                  &lt;/xp:tr&gt;
                  &lt;xp:tr&gt;
                      &lt;xp:td style="width:121.0px;background-color:rgb(233,233,233);border-color:rgb(192,192,192);border-style:dotted;border-width:thin"&gt;
                          &lt;xp:label value="Category:" id="category_Label1"
                              for="category1" style="font-weight:bold"&gt;
                          &lt;/xp:label&gt;
                      &lt;/xp:td&gt;
                      &lt;xp:td style="width:210.0px;border-color:rgb(192,192,192);border-style:dotted;border-width:thin"&gt;
                          &lt;xp:inputText value="#{document1.Category}"
                              id="category1"&gt;
                          &lt;/xp:inputText&gt;
                      &lt;/xp:td&gt;
                      &lt;xp:td style="width:16.0px"&gt;&lt;/xp:td&gt;
                      &lt;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"&gt;
                          &lt;xp:label value="Committee Approval Date:"
                              id="cmApprDate_Label1" for="cmApprDate1"&gt;
                          &lt;/xp:label&gt;
                      &lt;/td&gt;
                      &lt;td style="width:234.0px;border-color:rgb(192,192,192);border-style:dotted;border-width:thin"&gt;
                          &lt;xp:inputText value="#{document1.CmApprDate}"
                              id="cmApprDate1"&gt;
                          &lt;/xp:inputText&gt;
                      &lt;/td&gt;
                  &lt;/xp:tr&gt;
                  &lt;xp:tr&gt;
                      &lt;xp:td style="width:121.0px;background-color:rgb(233,233,233);border-color:rgb(192,192,192);border-style:dotted;border-width:thin"&gt;
                          &lt;xp:label value="Sub Category:"
                              id="subCategory_Label1" for="subCategory1" style="font-weight:bold"&gt;
                          &lt;/xp:label&gt;
                      &lt;/xp:td&gt;
                      &lt;xp:td style="width:210.0px;border-color:rgb(192,192,192);border-style:dotted;border-width:thin"&gt;
                          &lt;xp:inputText value="#{document1.SubCategory}"
                              id="subCategory1"&gt;
                          &lt;/xp:inputText&gt;
                      &lt;/xp:td&gt;
                      &lt;xp:td style="width:16.0px"&gt;&lt;/xp:td&gt;
                      &lt;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"&gt;
                          &lt;xp:label value="Last Reviewed Date:"
                              id="lastRevDt_Label1" for="lastRevDt1"&gt;
                          &lt;/xp:label&gt;
                      &lt;/td&gt;
                      &lt;td style="width:234.0px;border-color:rgb(192,192,192);border-style:dotted;border-width:thin"&gt;
                          &lt;xp:inputText value="#{document1.LastRevDt}"
                              id="lastRevDt1"&gt;
                          &lt;/xp:inputText&gt;
                      &lt;/td&gt;
                  &lt;/xp:tr&gt;
                  &lt;xp:tr&gt;
                      &lt;xp:td style="width:121.0px;border-color:rgb(192,192,192);border-style:dotted;border-width:thin;background-color:rgb(233,233,233)"&gt;
                          &lt;xp:label value="Policy Status:"
                              id="polStatus_Label1" for="polStatus1" style="font-weight:bold"&gt;
                          &lt;/xp:label&gt;
                      &lt;/xp:td&gt;
                      &lt;xp:td style="width:210.0px;border-color:rgb(192,192,192);border-style:dotted;border-width:thin"&gt;
                          &lt;xp:inputText value="#{document1.PolStatus}"
                              id="polStatus1"&gt;
                          &lt;/xp:inputText&gt;
                      &lt;/xp:td&gt;
                      &lt;xp:td style="width:16.0px"&gt;&lt;/xp:td&gt;
                      &lt;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"&gt;
                          &lt;xp:label value="Review Frequency:"
                              id="reviewFreq_Label1" for="reviewFreq1"&gt;
                          &lt;/xp:label&gt;
                      &lt;/td&gt;
                      &lt;td style="width:234.0px;border-color:rgb(192,192,192);border-style:dotted;border-width:thin"&gt;
                          &lt;xp:inputText value="#{document1.ReviewFreq}"
                              id="reviewFreq1"&gt;
                          &lt;/xp:inputText&gt;
                      &lt;/td&gt;
                  &lt;/xp:tr&gt;
                  &lt;xp:tr&gt;
                      &lt;xp:td style="width:121.0px;background-color:rgb(233,233,233);border-color:rgb(192,192,192);border-style:dotted;border-width:thin"&gt;
                          &lt;xp:label value="Inactive Date:"
                              id="inactDate_Label1" for="inactDate1" style="font-weight:bold"&gt;
                          &lt;/xp:label&gt;
                      &lt;/xp:td&gt;
                      &lt;xp:td style="width:210.0px;border-color:rgb(192,192,192);border-style:dotted;border-width:thin"&gt;
                          &lt;xp:inputText value="#{document1.InactDate}"
                              id="inactDate1"&gt;
                          &lt;/xp:inputText&gt;
                      &lt;/xp:td&gt;
                      &lt;xp:td style="width:16.0px"&gt;&lt;/xp:td&gt;
                      &lt;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"&gt;
                          &lt;xp:label value="Policy Owner E-mail Address:"
                              id="respEmail_Label1" for="respEmail1"&gt;
                          &lt;/xp:label&gt;
                      &lt;/td&gt;
                      &lt;td style="width:234.0px;border-color:rgb(192,192,192);border-style:dotted;border-width:thin"&gt;
                          &lt;xp:inputText value="#{document1.RespEmail}"
                              id="respEmail1"&gt;
                          &lt;/xp:inputText&gt;
                      &lt;/td&gt;
                  &lt;/xp:tr&gt;
  
  
  
  
  
  
  
              &lt;/xp:table&gt;
              &lt;xp:br&gt;&lt;/xp:br&gt;
              &lt;xp:table style="width:99.0%;padding-left:5.0px;padding-right:5.0px"&gt;
                  &lt;xp:tr&gt;
  
                      &lt;xp:td style="width:718.0px"&gt;
                          &lt;xp:label value="Policy Statement:"
                              id="polStmt_Label1" for="polStmt1"
                              style="font-size:10pt;font-weight:bold;color:rgb(0,0,128)"&gt;
                          &lt;/xp:label&gt;
                      &lt;/xp:td&gt;
                  &lt;/xp:tr&gt;
                  &lt;tr&gt;
                      &lt;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"&gt;
                          &lt;xp:inputRichText value="#{document1.PolStmt}"
                              id="polStmt1" style="width:98%;height:auto"&gt;
                          &lt;/xp:inputRichText&gt;
                      &lt;/xp:td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;xp:td&gt;
                          &lt;xp:label value="Policy Rationale:"
                              id="polRat_Label1" for="polRat1"
                              style="color:rgb(0,0,128);font-weight:bold;font-size:10pt"&gt;
                          &lt;/xp:label&gt;
                      &lt;/xp:td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;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"&gt;
                          &lt;xp:inputRichText value="#{document1.PolRat}"
                              id="polRat1" style="width:98.0%"&gt;
                          &lt;/xp:inputRichText&gt;
                      &lt;/xp:td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;xp:td&gt;
                          &lt;xp:label value="Policy Scope:"
                              id="polScope_Label1" for="polScope1"
                              style="font-size:10pt;color:rgb(0,0,128);font-weight:bold"&gt;
                          &lt;/xp:label&gt;
                      &lt;/xp:td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;xp:td style="border-color:rgb(192,192,192);border-style:solid;border-width:thin;padding-left:15.0px;padding-right:15.0px"&gt;
                          &lt;xp:inputRichText value="#{document1.PolScope}"
                              id="polScope1" style="width:98.0%;height:auto"&gt;
                          &lt;/xp:inputRichText&gt;
                      &lt;/xp:td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;xp:td&gt;
                          &lt;xp:label value="Policy Guide:"
                              id="polGuide_Label1" for="polGuide1"
                              style="color:rgb(0,0,128);font-size:10pt;font-weight:bold"&gt;
                          &lt;/xp:label&gt;
                      &lt;/xp:td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;xp:td style="padding-left:15.0px;padding-right:15.0px;border-color:rgb(192,192,192);border-style:solid;border-width:thin"&gt;
                          &lt;xp:inputRichText value="#{document1.PolGuide}"
                              id="polGuide1" style="width:98.0%;height:auto"&gt;
                          &lt;/xp:inputRichText&gt;
                      &lt;/xp:td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;xp:td&gt;
                          &lt;xp:label value="Associated Procedures:"
                              id="polProc_Label1" for="polProc1"
                              style="color:rgb(0,0,128);font-size:10pt;font-weight:bold"&gt;
                          &lt;/xp:label&gt;
                      &lt;/xp:td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;xp:td style="padding-left:15.0px;padding-right:15.0px;border-color:rgb(192,192,192);border-style:solid;border-width:thin"&gt;
                          &lt;xp:inputRichText value="#{document1.PolProc}"
                              id="polProc1" style="width:98%;height:auto"&gt;
                          &lt;/xp:inputRichText&gt;
                      &lt;/xp:td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;xp:td&gt;
                          &lt;xp:label value="Monitoring:" id="polMon_Label1"
                              for="polMon1"
                              style="color:rgb(0,0,128);font-size:10pt;font-weight:bold"&gt;
                          &lt;/xp:label&gt;
                      &lt;/xp:td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;xp:td style="padding-left:15.0px;padding-right:15.0px;border-color:rgb(192,192,192);border-style:solid;border-width:thin"&gt;
                          &lt;xp:inputRichText value="#{document1.PolMon}"
                              id="polMon1" style="width:98%;height:auto"&gt;
                          &lt;/xp:inputRichText&gt;
                      &lt;/xp:td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;xp:td&gt;
                          &lt;xp:label value="Definitions:"
                              id="polDef_Label1" for="polDef1"
                              style="color:rgb(0,0,128);font-size:10pt;font-weight:bold"&gt;
                          &lt;/xp:label&gt;
                      &lt;/xp:td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;xp:td style="padding-left:15.0px;padding-right:15.0px;border-color:rgb(192,192,192);border-style:solid;border-width:thin"&gt;
                          &lt;xp:inputRichText value="#{document1.PolDef}"
                              id="polDef1" style="height:auto;width:98.0%"&gt;
                          &lt;/xp:inputRichText&gt;
                      &lt;/xp:td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;xp:td&gt;
                          &lt;xp:label id="polDef_Label2" for="polDef2"
                              style="color:rgb(0,0,128);font-size:10pt;font-weight:bold"&gt;
                              &lt;xp:this.value&gt;&lt;![CDATA[Links &amp; References:]]&gt;&lt;/xp:this.value&gt;
                          &lt;/xp:label&gt;
                      &lt;/xp:td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;xp:td style="padding-left:15.0px;padding-right:15.0px;border-color:rgb(192,192,192);border-style:solid;border-width:thin"&gt;
                          &lt;xp:inputRichText value="#{document1.PolDef}"
                              id="polDef2" style="width:98%;height:auto"&gt;
                          &lt;/xp:inputRichText&gt;
                      &lt;/xp:td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;xp:td&gt;
  
                          &lt;xp:label value="Relevant Governance Standards:"
                              id="polStds_Label1" for="polStds1"
                              style="font-size:10pt;color:rgb(0,0,128);font-weight:bold"&gt;
  
                          &lt;xp:this.rendered&gt;&lt;![CDATA[#{javascript:!@Contains(getComponent("display").getValue(), "RGStandards")}]]&gt;&lt;/xp:this.rendered&gt;&lt;/xp:label&gt;
                      &lt;/xp:td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;xp:td
                          style="padding-left:15.0px;padding-right:15.0px;border-color:rgb(192,192,192);border-style:solid;border-width:thin"&gt;
  
                          &lt;xp:inputRichText value="#{document1.PolStds}"
                              id="polStds1" style="height:auto;width:98%"&gt;
  
                          &lt;/xp:inputRichText&gt;
                      &lt;/xp:td&gt;
                  &lt;/tr&gt;
  
  
  
  
  
  
  
  
  
  
  
              &lt;/xp:table&gt;
          &lt;/xp:panel&gt;
      &lt;/xp:panel&gt;
  &lt;/xp:view&gt;
  </code></pre>
  
  <p>The values are for example
  "Rationale"
  "AssocProc"
  "Definition"
  "Link"</p>