This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Apr 24, 2013, 1:54 AM
6 Posts
topic has been resolvedResolved

Multiple Values not displaying correctly in View Panel

  • Category: Other
  • Platform: Windows
  • Release: 8.5.2
  • Role:
  • Tags:
  • Replies: 5
I have a form with a bunch of fields and 3 multiple value fields (Name,SSN,Comments) that I am trying to display on an Xpage within a view panel. My view shows all multiple values as separate entries. When I use the view panel to place the view on my Xpage, all values in the view are shown correctly (one entry per line). However, when I filter the view panel to only show records relating to the document (filter by Tracking Number), it does not show correctly. For example, if there are 5 values in the Name field, the view panel will show 5 entries but it will be the first value repeated 5 times. Can anyone help me with this?
Apr 24, 2013, 3:49 AM
110 Posts
Re: Multiple Values not displaying correctly in View Panel
 Can you include your source? I change the view selection formula and it worked.
Apr 25, 2013, 12:54 AM
6 Posts
Re: Multiple Values not displaying correctly in View Panel
Here is the source:

<?xml version="1.0" encoding="UTF-8"?>

<xp:view xmlns:xp="http://www.ibm.com/xsp/core">

<xp:this.data>

<xp:dominoDocument var="doc1" formName="frmtest"></xp:dominoDocument>

</xp:this.data>

<xp:this.resources>

<xp:script src="/TableWalker.jss" clientSide="false"></xp:script>

</xp:this.resources>

<xp:table>

<xp:tr>

<xp:td>

<xp:label value="Tracking number:"

id="trackingNumber_Label1" for="trackingNumber1">

</xp:label>

</xp:td>

<xp:td>

<xp:inputText value="#{doc1.TrackingNumber}"

id="trackingNumber1">

</xp:inputText>

</xp:td>

</xp:tr>

</xp:table>

<xp:br></xp:br>

<xp:table>

<xp:tr>

<xp:td>

<xp:label value="Full Name:" id="fullName_Label2"

for="fullName2">

</xp:label>

</xp:td>

<xp:td>

<xp:inputText value="#{doc1.FullName}" id="fullName2">

</xp:inputText>

</xp:td>

</xp:tr>

<xp:tr>

<xp:td>

<xp:label value="ID:" id="ID_Label1" for="ID"></xp:label>

</xp:td>

<xp:td>

<xp:inputText value="#{doc1.ID}" id="ID"></xp:inputText>

</xp:td>

</xp:tr>

<xp:tr>

<xp:td>

<xp:label value="Home phone:" id="homePhone_Label1"

for="homePhone1">

</xp:label>

</xp:td>

<xp:td>

<xp:inputText value="#{doc1.HomePhone}"

id="homePhone1">

</xp:inputText>

</xp:td>

</xp:tr>

<xp:tr>

<xp:td>

<xp:label value="Work phone:" id="workPhone_Label1"

for="workPhone1">

</xp:label>

</xp:td>

<xp:td>

<xp:inputText value="#{doc1.WorkPhone}"

id="workPhone1">

</xp:inputText>

</xp:td>

</xp:tr>

</xp:table>

<xp:br></xp:br>

<xp:table id="repeatTable">

<xp:tr>

<xp:td></xp:td>

<xp:td>

<xp:label value="Name" id="label1"></xp:label>

</xp:td>

<xp:td>

<xp:label value="SSN" id="label2"></xp:label>

</xp:td>

<xp:td>

<xp:label value="Comments" id="label5"></xp:label>

</xp:td>

</xp:tr>

<xp:repeat id="fieldGroup" rows="30" var="fieldGroup"

indexVar="rowIndex">

<xp:this.value><![CDATA[#{javascript:var scopeVariableName = "group";

var fieldNames = "name,ssn,comments";

tableWalker.getDataSource(scopeVariableName,doc1,fieldNames)}]]></xp:this.value>

<xp:tr>

<xp:td>

<xp:button value="Add Row" id="button3">

<xp:eventHandler event="onclick" submit="true"

refreshMode="complete" id="eventHandler1">

<xp:this.action><![CDATA[#{javascript:tableWalker.addRow("group", rowIndex+1)}]]></xp:this.action>

</xp:eventHandler>

</xp:button>

<xp:button value="Delete Row" id="button2">

<xp:eventHandler event="onclick" submit="true"

refreshMode="complete" id="eventHandler2">

<xp:this.action><![CDATA[#{javascript:tableWalker.removeRow("group", rowIndex)}]]></xp:this.action>

</xp:eventHandler>

</xp:button>

</xp:td>

<xp:td>

<xp:inputText id="cxName">

<xp:this.value><![CDATA[#{fieldGroup[0]}]]></xp:this.value>

</xp:inputText>

</xp:td>

<xp:td>

<xp:inputText id="cxSSN">

<xp:this.value><![CDATA[#{fieldGroup[1]}]]></xp:this.value>

</xp:inputText>

</xp:td>

<xp:td>

<xp:inputTextarea id="cxComments">

<xp:this.value><![CDATA[#{fieldGroup[2]}]]></xp:this.value>

</xp:inputTextarea>

</xp:td>

</xp:tr>

</xp:repeat>

<xp:tr>

<xp:td colspan="4">

<xp:button value="Add" id="button4"

style="text-align:center">

<xp:eventHandler event="onclick" submit="true"

refreshMode="complete">

<xp:this.action><![CDATA[#{javascript:tableWalker.addRow("group")}]]></xp:this.action>

</xp:eventHandler>

</xp:button>

<xp:button value="Save" id="button5">

<xp:eventHandler event="onclick" submit="true"

refreshMode="complete">

<xp:this.action><![CDATA[#{javascript:tableWalker.updateDocument("group", doc1)

doc1.save()}]]></xp:this.action>

</xp:eventHandler>

</xp:button>

</xp:td>

</xp:tr>

</xp:table>

<xp:br></xp:br>

<xp:button value="Save" id="button1">

<xp:eventHandler event="onclick" submit="true"

refreshMode="complete">

<xp:this.action>

<xp:save></xp:save>

</xp:this.action>

</xp:eventHandler>

</xp:button>

<xp:br></xp:br>

<xp:viewPanel rows="30" id="viewPanel1">

<xp:this.facets>

<xp:pager partialRefresh="true" layout="Previous Group Next"

xp:key="headerPager" id="pager1">

</xp:pager>

</xp:this.facets>

<xp:this.data>

<xp:dominoView var="view1" viewName="vwtest">

<xp:this.keys><![CDATA[#{javascript:doc1.getValue("TrackingNumber")}]]></xp:this.keys>

</xp:dominoView>

</xp:this.data>

<xp:viewColumn columnName="TrackingNumber" id="viewColumn1">

<xp:viewColumnHeader value="TrackingNumber"

id="viewColumnHeader1">

</xp:viewColumnHeader>

</xp:viewColumn>

<xp:viewColumn columnName="Name" id="viewColumn2">

<xp:viewColumnHeader value="Name" id="viewColumnHeader2"></xp:viewColumnHeader>

</xp:viewColumn>

<xp:viewColumn columnName="SSN" id="viewColumn3">

<xp:viewColumnHeader value="SSN" id="viewColumnHeader3"></xp:viewColumnHeader>

</xp:viewColumn>

<xp:viewColumn columnName="cxComments" id="viewColumn4">

<xp:viewColumnHeader value="cxComments"

id="viewColumnHeader4">

</xp:viewColumnHeader>

</xp:viewColumn>

</xp:viewPanel>

<xp:br></xp:br>

</xp:view>

 
Apr 25, 2013, 1:38 AM
110 Posts
Re: Multiple Values not displaying correctly in View Panel
 Go to your XPage > Events > beforeRenderResponse > enter the following code:

view1.setSelectionFormula('SELECT ((Form = "test1") & (Tracking="'+doc1.getItemValue('TrackingNumber')+'"))')

Remove the 'Filter by Column Value' from your view datasource. 

If this view is important and is used for lookup by other part of the system, you might want to create a specific view just for display purpose to be used by this page and above code because this will change the view selection formula every time the page is load (you can check the view's selection formula after the page is loaded). Caution though, as this method is a bit slow because each time, the view selection formula is changed and the view is rebuild. It might be slow if your data is getting too big or you have some complex formula in that view. 

You can also put the above code in buttons that will open the page that contains any view you would like to display as such. And when any of the page is close, just reset back the selection formula when exiting the page with the following example code:

 view1.setSelectionFormula('SELECT ((Form = "test1"))
Apr 30, 2013, 2:09 PM
17 Posts
Re: Multiple Values not displaying correctly in View Panel
I had exactly the same problem, it was driving me mad.....   I devised a workaround for this, see the link below:

Bascially, you find where your document is in the view and this will be the start index, and the repeat index is the number of items in your multi value field. 
May 9, 2013, 1:45 AM
453 Posts
Re: Multiple Values not displaying correctly in View Panel
What I do is use a computed field and set the content to HTML then compute the field with the formula

@Implode(myField,"<br>")

easy to do and works well, I have not tried it in a standard view but works well in a repeat control or a dataview. I use it all the time in the Detail panel to display Associated Multi-Value fields.  Have also used it by @Implode  using a new line character, but have kind of standardized on using the HTML <br>. Seems to work most everywhere.

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal