XPages Multi Select Dialog Control - Feature Request: Allow choice of @DbLookup or @DbColumn to populate picklist| Created on |
Mar 17, 2010 |
| Created by |
Judy Kilpinen |
| Status |
Submitted |
To do above I added a "key" string and "type" combobox property (choices: @DbLookup, @DbColumn) to the ccMultiSelectDialog control, then hacked away at the repeat control's Javascript thusly:
//May need to expand for also incoming Array etc
//However API allows manual creation/insertion
var thisDB=@DbName();
if(compositeData.serverName!="" && compositeData.serverName!=null){
thisDB[0]=compositeData.serverName;
}
if(compositeData.dbName!="" && compositeData.dbName!=null){
thisDB[1]=compositeData.dbName;
}
if(compositeData.viewName!=""){
if(compositeData.type!="" && compositeData.type!=null){
if(compositeData.type=="@DbLookup" && compositeData.key!="" && compositeData.key!=null){
return @Unique(@Explode(@DbLookup(thisDB,compositeData.viewName,compositeData.key,compositeData.column),","));}
else{
return @Unique(@Explode(@DbColumn(thisDB,compositeData.viewName,compositeData.column),","));}
}
else{
return @Unique(@Explode(@DbColumn(thisDB,compositeData.viewName,compositeData.column),","));}
}
else{
return "";
}
It works, however is not very elegant. I'm sure you can devise something much better.
Also, it would be a nice addition to handle the situation of no values retrieved from the @DbColumn/@DbLookup.
Thanks for the control, Steve !! -- I'd been hunting for something just like this.
Taken Actions by OwnersNo actions have been taken yet.