PDA

View Full Version : Fixed!! Ws.Picklist search box not working on remote databases



mth96a
29 Aug 2007, 2:08 PM
It always returns nothing, but if i start typing and it pulls up the search box, it will find the record. Anyone know how to fix this? The database is ft indexed.

jratcliff
29 Aug 2007, 2:16 PM
can you post your code for the picklist?

mth96a
30 Aug 2007, 4:43 AM
var myApp2 = function(){
var ws;
var showBtn, dialog;
var frm2= window.document.forms[0];
return {
init : function() {


showBtn = Ext.get('show-dialog-btn1');
showBtn.on('click', this.showPL, this);
},

showPL : function(){
ws = new Ext.nd.UIWorkspace();
ws.PickList({
server : "notes1",
dbPath : "/applications/hr/orgchart.nsf/",
viewName : "(By EMPID3)",
title : 'Pick The EMPID',
prompt : '',
count : 200,
column : '2',
callback : this.handleMyPickList
});
},

// the return of the PickList will be an array of strings
handleMyPickList : function(arStrings) {
var tmp = "";
var frm2= window.document.forms[0];
if (arStrings == null) {
;
} else {
for (var i=0; i<arStrings.length; i++) {
tmp += arStrings[i] ;
}
frm2.empid.value = tmp;
_doClick('$Refresh',this,null)
}
}

};

}();

Ext.onReady(myApp2.init, myApp2, true);

mth96a
4 Sep 2007, 11:34 AM
the other database is full text indexed, but searching works on the local database

anyone have any tips?

mth96a
4 Sep 2007, 11:58 AM
i have tried unsuccessfully to make the search disapear in the picklist. has anyone done this?

here is what i tried


showPL : function(){
ws = new Ext.nd.UIWorkspace();
ws.PickList({
dbPath : "/applications/hr/orgchart.nsf/",
viewName : "(By EMPID3)",
title : 'Pick The EMPID',
prompt: '',
column : '2',
callback : this.handleMyPickList,
uiView : {showSearch : false}
});
},

RWaters
5 Sep 2007, 10:54 AM
I just took at look at the picklist code, it looks like there's not currently a way to pass in parameters to the uiView like you were trying above. uiView references the object once it is created, currently all it does is looks to see if there was something already in uiView and if so, destroys it before creating the new one.

Also, just for a quick note, the pop-up search box is different from the search in the toolbar, setting showSearch: false currently only turns off the box that would appear within the toolbar.

I'm looking into some tweaks right now to allow passing in options to the view, I'll also do some testing with search within the picklist as I don't believe we have.

RWaters
5 Sep 2007, 10:59 AM
Alright, I made a quick addition to UIWorkspace that allows you to pass in viewOptions, ie:


showPL : function(){
ws = new Ext.nd.UIWorkspace();
ws.PickList({
dbPath : "/applications/hr/orgchart.nsf/",
viewName : "(By EMPID3)",
title : 'Pick The EMPID',
prompt: '',
column : '2',
callback : this.handleMyPickList,
viewOptions : {showSearch : false}
});
},

This will be available in the next release, or you can manually fix it:

Index: C:/Documents and Settings/rwaters/Desktop/Extnd/trunk/source/domino/UIWorkspace.js
===================================================================
--- C:/Documents and Settings/rwaters/Desktop/Extnd/trunk/source/domino/UIWorkspace.js (revision 162)
+++ C:/Documents and Settings/rwaters/Desktop/Extnd/trunk/source/domino/UIWorkspace.js (working copy)
@@ -37,6 +37,8 @@
this.type = "custom";
this.select = "single";

+ this.viewOptions = "";
+
this.title = "PickList";
this.prompt = "Please make your selection(s) and click <OK>.";
this.column = 0;
@@ -108,7 +110,7 @@
}));

// now create the view
- this.uiView = new Ext.nd.UIView({
+ this.uiView = new Ext.nd.UIView(Ext.apply({
container : viewPanel,
viewUrl : this.viewUrl,
gridHandleRowDblClick : handleOK.createDelegate(this),
@@ -116,7 +118,7 @@
emptyText : this.emptyText,
showCategoryComboBox : this.showCategoryComboBox,
categoryComboBoxCount : this.categoryComboBoxCount
- });
+ },this.viewOptions);

// tell the layout we are done so it can draw itself on the screen
layout.endUpdate();

mth96a
5 Sep 2007, 1:01 PM
I added the code to the extnd/source/domino/UIWorkspace.js and it still wont hide the search box on the bottom. I aslo added the code to the ws.picklist function i called

Any ideas?

RWaters
5 Sep 2007, 1:04 PM
You'll either need to include UIWorkspace.js after extnd-all, rebuild extnd-all with JSBuilder, or manually make the changes in the extnd-all.js file.

mth96a
5 Sep 2007, 1:48 PM
missing : after property id
[Break on this error] this.uiView = new Ext.nd.UIView(Ext.apply({\n

mth96a
6 Sep 2007, 6:01 AM
this.uiView = new Ext.nd.UIView(Ext.apply({
container : viewPanel,
viewUrl : this.viewUrl,
gridHandleRowDblClick : handleOK.createDelegate(this),
emptyText : this.emptyText,
showCategoryComboBox : this.showCategoryComboBox,
categoryComboBoxCount : this.categoryComboBoxCount
},this.viewOptions));

mth96a
6 Sep 2007, 6:51 AM
Though i pass the dbPath in the view options it works for the second two calls but not to the NotesDXLExporter agent, it does not get the right path to new view we are looking at. Does anyone know how to fix this?


showPL : function(){
ws = new Ext.nd.UIWorkspace();
ws.PickList({
dbPath : "/applications/hr/orgchart.nsf/",
viewName : "By EMPID4",
title : 'Pick The EMPID',
prompt: '',
column : '2',
callback : this.handleMyPickList,
viewOptions : {dbPath : "/applications/hr/orgchart.nsf/",
showSearch : false,
count : 200, showActionbar: true,
toolbar : false}
});
},

mth96a
10 Sep 2007, 6:22 AM
in the $Ext.nd.SearchView agent in your extnd database replace these lines



strDb = GetParameter("db",strParameters)
If Instr(strDB, "/") =1 Then
strDb = Strright(strDB, "/")
strDB = Strleftback(strdb,"/")

Msgbox("Changed the strdb to : " & strdb)
End If

While Instr(strDB, "/") > 0
strDb = Replace(strDb,"/","\")
Wend

Msgbox("Changed the strdb to : " & strdb)
strView = GetParameter("vw",strParameters)
strQuery = GetParameter("query",strParameters)
intMax = 0

And then in the uiview portion of the extnd-all change the search parms to this


var ds = new Ext.nd.data.DominoViewStore({
proxy: new Ext.data.HttpProxy({
url: Ext.nd.extndUrl+'($Ext.nd.SearchView)?OpenAgent',
method: "GET"
}),
baseParams: {db: this.dbPath , vw: this.viewName },
reader: viewEntryReader,
remoteSort: false
});

the problem was with the session was still pointed to the first db opened so it was passing the wrong view to the wrong database to search

jratcliff
10 Sep 2007, 8:55 PM
Thanks mth96a! We'll be sure to include your fix in the next release! =D>

mth96a
11 Sep 2007, 4:50 AM
The view options is a great addition as well