-
I’m attempting to present one (or more) combo boxes for the user to select a category then filter a xp:dominoView based on the combo box selection(s). I have the current category selection(s) in sessionScope and the xp:this.keys uses those selection(s) to build a filter Vector as shown by numerous posts here in the forum.
-
This particular View may at times only show one category, or it may show more than one category. If it shows more than one, everything works perfect. I see more than one combo box for the multiple categories, and when I select a new category in the first combo box, the others update along with the View contents to reflect was selected.
-
But if the View happens to need to show only one category, the View contents are not present, as if it’s filtering out everything. The code is the same; the only difference is how many entries are in the Vector, one or more than one. Because the current criteria contains no data, the entire View rendering is skipped and it says there’s nothing to display.
-
I tried computing xp:this.keys if more than one category exists, and xp:this.categoryFilter if only one is present, but the result is the same.
-
The xp:dominoView drives everything. If the repeat that renders the xp:dominoView has zero rows, then the text displays. If that repeat has more than zero rows, then it renders that content. For some reason, when only one cateogry is used, so keys has one entry, it simply has no rows.
Any idea what could be happening here?
EDIT:
Here’s the XPage source, which currently has category & sub-category as “hardcoded” variables:
<xp:dominoView var="someView" viewName="#{javascript:compositeData.viewName}">
<xp:this.keys><![CDATA[#{javascript:
print(“Processing keys "”+sessionScope.topCat+“/”+sessionScope.leafCat+“"”);
if(sessionScope.topCat && sessionScope.topCat!=“”) {
if(sessionScope.leafCat && sessionScope.leafCat!="") {
print("-> Vector topCat & leafCat");
var keys:java.util.Vector=new java.util.Vector();
keys.addElement(sessionScope.topCat);
keys.addElement(sessionScope.leafCat);
return keys;
} else {
print("-> Vector topCat only");
var keys:java.util.Vector=new java.util.Vector();
keys.addElement(sessionScope.topCat);
return keys;
}
}
print(“-> Keys nullified”);
return null;
}]]></xp:this.keys>
<!-- xp:this.categoryFilter><![CDATA[#{javascript:
if(sessionScope.topCat && sessionScope.topCat!=“”) {
if(!sessionScope.leafCat || sessionScope.leafCat=="") {
print("-> Single category");
return sessionScope.topCat;
}
}
return null;
}]]></xp:this.categoryFilter -->
</xp:dominoView>
Here’s the server console output:
07/26/2010 01:01:10 PM HTTP JVM: Processing keys “2007-JUL/null”
07/26/2010 01:01:10 PM HTTP JVM: → Vector topCat only
07/26/2010 01:01:10 PM HTTP JVM: Processing keys “2007-JUL/null”
07/26/2010 01:01:10 PM HTTP JVM: → Vector topCat only
- I don’t know why this appears twice like this, but it does exactly the same thing for more than one category, and that works.
Thanks for your time…