I’m trying to do a typeahead, based on an @DbColumn looking to a view in another database. If I explicitly name the view and database in the @DbColumn formula, it works fine. But the values are picking from config documents, and vary depending on the XPage used, so I’m using compositeData.directoryPath and compositeData.directoryView. I’ve used labels to ensure I’m returning the correct values, but cannot seem to get them to work in an @DbColumn. The formula I’m using is below. If I replace the compositeData variables with the returned data it works fine.
var lview = compositeData.directoryView;
var lpath = @ReplaceSubstring(compositeData.directoryView, “\”, “\\”);
@Unique(@DbColumn([@Subset(@DbName(), 1), lpath], lview, 5))
If anyone has encountered this, or has any ideas, they would be appreciated.
Subject: View lookup in Type Ahead based on compositeData
I am having the same problem and I wondered if you’d had any luck with finding a solution to this.
I am trying to programmatically pass through the view name to a type ahead field, so that the custom control is re-useable. If I type the viewname in to the code it works, if I enter compositeData.viewName then it does not.
code is:
@DbLookup(@DbName(),compositeData.viewName,key,1,“[PARTIALMATCH]”)
Thanks in advance
Fee
Subject: SOLUTION - View lookup in Type Ahead based on compositeData
The way I got around the problem of not being able to use a compositeData variable in the calculation of a type ahead field was by:
-
Adding a ‘beforePageLoad’ event to the custom control of viewScope.currentView=compositeData.viewName;
-
Updated the type ahead field calculation to use the viewScope.currentView variable
eg: @DbLookup(@DbName(),viewScope.currentView,key,1,“[PARTIALMATCH]”);
Hope this helps!