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



Jun 6, 2013, 11:41 AM
47 Posts

Filter value in repeat control

  • Category: Documentation
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags: Repeat Control,filter
  • Replies: 2

I am using a repeat control in a custom control to show elements from a view.  My view contains main and responses documents and is not categorized.

My XPages has a layout that contains a facet with the custom control.

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xc="http://www.ibm.com/xsp/custom">
 <xp:this.data>
  <!-- view is using Expense and Expense Line forms (responses) -->
  <xp:dominoView var="view1" viewName="vwExResponses"
   databaseName="taiexpenses.nsf" />
 </xp:this.data> 
 <xc:layoutHome navigationPath="Home">
  <xp:this.facets>
   <xp:panel xp:key="facetMiddle" id="panel1">
    <xc:ccRepeatExpResp2></xc:ccRepeatExpResp2>
   </xp:panel>
  </xp:this.facets>
 </xc:layoutHome>
</xp:view>

The repeat control is working great except that when I enter a computed value in"Filter by column value",
I can see only the main documents. (the filter is the username).

...

 <xp:this.data>
  <xp:dominoView var="view1" databaseName="taiexpenses.nsf"
   viewName="vwExResponses" expandLevel="2"
   keys="#{javascript:sessionScope.FilterValue ;}">
  </xp:dominoView>
 </xp:this.data>

...

The Home page is setting the sessionScope variable...
<xp:this.afterPageLoad>
  <![CDATA[#{javascript:sessionScope.put("FilterValue",context.getUser().getCommonName() )}]]>
</xp:this.afterPageLoad>

If I comment the filter keys="#{javascript:sessionScope.FilterValue ;}" I can see main and responses, but will have to go through some 100 pages to get to what I wan to see.  I tried to put a Search but again it is showing the main documents only.

I think my problem is in the keys but I don't know how to get all the responses for only one user.

Jun 7, 2013, 3:39 PM
586 Posts
hmmm

Not sure what to tell you so just some random thoughts...

When filtering you can pass in a vector to work against multiple columns...  not sure if that helps...

I've never used true response docs in xpages..  I don't know what you're view really looks like but I would probably approach it with 2 nested repeats...  an outer repeat of the "main" documents and an inner repeat of the "response" documents.

then filtering on the outer repeat should not affect anyting in the inner repeat I'd think.

 

Hope that helps!

Dave

Jun 11, 2013, 11:03 AM
47 Posts
I can't see my second repeat...

Hi David,

 

I did what you suggested but it is not working.  I never see my inside repeat.  Here is the code:

 

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

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

<xp:this.resources>

<xp:styleSheet href="/custom.css"></xp:styleSheet>

</xp:this.resources>

<xp:this.data>

<xp:dominoView var="ExpAndResp" databaseName="taiexpenses.nsf"

viewName="vwExResponses">

</xp:dominoView>

</xp:this.data>

<xp:panel>

 

<xp:table>

<xp:tr styleClass="repLabel">

<th>For</th>

<th>Claim Date</th>

<th>Status</th>

<th>Cities</th>

</xp:tr>

<xp:repeat value="#{ExpAndResp}" var="person" rows="100">

<tr id="trowUser" styleClass="Expense">

<xp:td style="width:120.0px">

<xp:text escape="false" id="computedField1"

value="#{person.userName}">

</xp:text>

</xp:td>

<xp:td style="text-align:center">

<xp:text escape="false" id="computedField2"

value="#{person.expenseDate}">

</xp:text>

</xp:td>

<xp:td style="width:110.0px">

<xp:div style="text-align:center">

<xp:text escape="true" id="computedField4"

value="#{person.$14}">

</xp:text>

</xp:div>

</xp:td>

<xp:td style="width:140.0px">

<xp:text escape="true" id="computedField5"

value="#{person.cities}">

</xp:text>

</xp:td>

</tr>

<!-- SECOND REPEAT HERE -->

<xp:repeat id="repeatLines" rows="15" var="rowData"

indexVar="rowNum">

<xp:this.value><![CDATA[#{javascript:if (sessionScope.FilterValue ==null) return false;

 

var db:NotesDatabase = session.getDatabase(database.getServer(), "taiexpenses.nsf");

var expLines:NotesView = db.getView("vwExResponses");

 

var keysVector = new java.util.Vector();

keysVector.addElement(sessionScope.FilterValue);

var eColl:NotesViewEntryCollection = expLines.getAllEntriesByKey(keysVector,true);

return eColl}]]></xp:this.value>

<tr id="trow" styleClass="ExpenseLine">

<xp:td style="width:140.0px">

<xp:text escape="true"

id="computedField8">

<xp:this.value><![CDATA[#{javascript:repeatLines.getDocument().getItemValue('cities');

}]]></xp:this.value>

</xp:text>

</xp:td>

</tr>

</xp:repeat>

</xp:repeat>

 

<xp:tr>

<xp:td></xp:td>

<xp:td></xp:td>

</xp:tr>

</xp:table>

</xp:panel>

 

</xp:vie

As I said before my view is flat but I also have the same view categorized on the username (For).  This view contains expenses reports.  An expense report is made of many expenses (expense lines) which are responses to the expense report. 

 

As you can  see I create a panel which contains a table.  This table has the column title as its first row, then the first repeat.  This repeat has a row (trowUser) for the data of the main documents (Expense) for each user.

Then, below the first row of the repeat, I put the second repeat (repeatLines) which has a row (trow) for each response (expense Line).  I can't see this line, I always receive the message "repeatLines" not found.  Where should I put the repeat so I can see it.

 

 


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