0
votes

I have an xPage which I have built with 3 combo boxes and 1 view control. I would like to use the 'Filter by column value' option within the view control to provide the options to filter the values, allowing the user to display any combination of the combo boxes. e.g. Only comboBox1, or comboBox1 and comboBox2, or comboBox3 only, or comboBox1 and comboBox2 and comboBox3.

I used the example in the 'xPages Demonstration Application' (http://www-10.lotus.com/ldd/ddwiki.nsf/dx/xpagesdemoapp.htm or http://xpagesblog.com/XPagesHome.nsf/Entry.xsp?documentId=AAC8E26599256FDC852578CB0066CC13) to do the multi-column filtering using a vector of non-categorized columns.

So, I have come across what appears to be a fairly major issue whereby the data needs to be sorted by date. Date is not one of the filters, but it needs to be the first column in order for the data to be sorted correctly. So my first column is a string, YYYYMMDD, to ensure the data is sorted correctly. I tried to use the sort option within the view control and that does not appear to work with the column filtering implemented in this manner.

So, as Date one of the criteria I am filtering by, I have passed that as an empty string - using the thought process that an empty string will select all (as in the url examples above).

The code I have used to do the filtering is:

var vtr:java.util.Vector = new java.util.Vector();
var t1 = sessionScope.Email;
var t2 = sessionScope.Own;
var t3 = sessionScope.Module;

vtr.addElement("");
@If(sessionScope.Own=="My calls",vtr.addElement(t1),vtr.addElement(""));
@If(sessionScope.Own=="My calls",vtr.addElement(""),vtr.addElement(t2));
@If(sessionScope.Status=="Open",vtr.addElement("Open"),vtr.addElement(""));
@If(sessionScope.Module=="All",vtr.addElement(""),vtr.addElement(t3));

return vtr;

What I have found is that not all data is being returned. I thought this might be due to the date field. So I removed it (changing the view and removing the first add element), and yet I still find that not all data is being returned. I suspect that this might be due to the empty strings being passed, or, that this does not actually work the way I had hoped.

Does anyone know if I can get this working the way I want it to, and if not, do you have any suggestion on how I can go about this?

1
Yeah, running 8.5.3 FP1.atom

1 Answers

1
votes
  1. Date is not needed as the first sortable column in the view. The first column does need to be sorted for the lookup to work just like the Notes view needs to be sorted for @DbColumn and @DbLookup to work. XPages uses the same underlining architecture. This example - http://dev.openntf.org/demos/demoapp.nsf/viewFilteringVector.xsp - works without the data being sorted by Date.
  2. My guess as to why your example isn't working is down to how your Notes view sorted. Try creating a new view with column 1 (email) ascending sort, column 2 (own) ascending sort, and column 3 (module) again ascending sort. You should be able to get vector filtering working in this situation.
  3. If all that doesn't work for you, you might consider multi-layer category filtering (new to 853). This filtering type in XPages is related to how categoryFilter works but allow you to filter a view by the sub-category (or sub-categories) too. This technique might suit your scenario better.

    Hope this helps.