Subscribe via Feed

DbColumn and DbLookup With Result as Guaranteed Array and With a Cache

Julian Buss, Jul 22, 2009 6:41:44 AM

@DbLookup has the issue that it returns a string when it found exactly one result, and an array when it found multiple results.

That means after each @DbLookup you have to check if your result is a string or an array if you want to process it further with JavaScript. 

Maybe you want to do the same @DbLookup multiple times on your XPage, for example if you have a listbox which fills it's values from a @DbLookup, but should be hidden when there are no values. For that case it would be nice to have the result of the first @DbLookup cached and re-used when needed the second time.

I added two ready-to-use functions in the XPages Wiki: http://xpageswiki.com/web/youatnotes/wiki-xpages.nsf/dx/Work_with_views



0 responses to DbColumn and DbLookup With Result as Guaranteed Array and With a Cache