Ben Dubuc
Ben Dubuc

Reputation: 523

Xpages DbLookup and combo boxes

Is it possible at all, in XPages, to have 3 combo boxes that are dependant from one another?

Let's say I have Province/State, City, StreetName: what do I need to have the StreetName drop down display values form the selected Province and City?

I tried with a categorized view, a flat view, but I can't get it to work. Is it that the DbLookup "key" can only be a string and not an array of strings?

This is what I tried:

@DbLookup(@DbName(), "v2Flat", ["MyProv","MyCity"], "StreetName")

that is using a flat view: returns all the street names, regardless of the selected city

@DbLookup(@DbName(), "v2Categorized", ["MyProv","MyCity"], "StreetName")

that is using a categorized view (StateProv, City as categories): returns only the first street name for the selected Prov/City.

All the fields are in a panel that is refreshed when first 2 combo boxes are changed (I know it works as the values listed in the street name combo change as well).

Am I wrong to think that an array can be used in a DbLookup???

Thanks

Upvotes: 0

Views: 444

Answers (1)

Howard
Howard

Reputation: 1503

Ben, not sure the @function implements using an array as a key, at least, I never got it to work.

Just use the Domino view object and getAllEntriesByKey

var linksView:NotesView = session.getCurrentDatabase().getView("myview");
var search = new java.util.Vector();
search.add("Checksheet");
search.add("APQP");
var entryCol:NotesViewEntryCollection = linksView.getAllEntriesByKey(search, true);

Then loop through entryCol and get what you need and add to an array one at a time.

Howard

Upvotes: 1

Related Questions