PDA

View Full Version : Address Book Live Search



mdm-adph
30 Aug 2007, 1:16 PM
NAB_Proxy_Url = "/names.nsf/($VIMPeopleByLastName)?readviewentries&Count=10&StartKey=";

NAB_Proxy = new Ext.data.HttpProxy({
url: NAB_Proxy_Url
});

NAB_Store = new Ext.data.Store({
proxy: NAB_Proxy,
reader: new Ext.data.XmlReader(
{
record: "viewentry",
id: 'address'
},
[
{name: "address", mapping: "entrydata[@columnnumber=1] > text"},
{name: "first", mapping: "entrydata[@columnnumber=2] > text"},
{name: "middle", mapping: "entrydata[@columnnumber=3] > text"},
{name: "last", mapping: "entrydata[@columnnumber=0] > text"}
]
)
});

var combo_names = new Ext.form.ComboBox({
allQuery: "",
displayField: 'address',
emptyText: 'Select an address...',
loadingText: 'Searching...',
resizable: true,
selectOnFocus: true,
store: NAB_Store,
triggerAction: "all",
typeAhead: true,
width: 300
});

combo_names.on("beforequery", function (e) {
NAB_Proxy.conn.url = NAB_Proxy_Url + e.query;
});

combo_names.applyTo('MemberName');Just something unrelated to Ext.nd (but related to Ext on Notes/Domino) that I've been working on. I've gotten it working in Firefox, but IE 6 is buggy as hell -- you can't enter backspace in the "MemberName" field without the page going backwards in the history. It's like the keystroke isn't being picked up or something.

Has someone here developed something similar that works better?

"($VIMPeopleByLastName)" is just a custom view in my organization's address book.

mdm-adph
31 Aug 2007, 6:55 AM
Never mind -- I figured out what it was. I had "this.blur()" in the onfocus handler. Don't ask why.

luoziseaer
27 Dec 2007, 10:21 AM
How about the node <textlist><text>blahblah...</text></textlist>,and it is may be <text>blahblah...</text>,can we use axis of xpath in XMLReader?
Thanks!

mdm-adph
31 Dec 2007, 9:51 AM
Sorry, I had forgotten about this thread (I've since made a much better live NAB picker) -- what was your question, exactly?

RWaters
1 Jan 2008, 9:34 AM
Care to share your new version? This is something that is often requested.

mdm-adph
4 Jan 2008, 12:04 PM
Hey -- sure, why not. It's still in hack-form, though, so be careful! :D

About the only thing you should need to change is the whole "($VIMPeopleByLastName)" -- just a custom view in our NAB that my firm uses. You'll have to change it to a view in your NAB -- depending on what view in your NAB you want, you may have to customize "Ext.ux.form.NABPicker.config.reader", as well.

Oh yeah, just remembered -- it uses a modified version of someone's old alpha extension that I got somewhere on these forums (it's the code that adds the "X" button to the side). If anyone might know where I got that from, let me know so I can credit the author!

RWaters
4 Jan 2008, 2:00 PM
Thanks for the start, I quickly hacked it up a bit to work with Ext 2.x. With more time it would make a good case to convert to a plugin instead of an extension.

Also, looks like ($VIMPeopleByLastName) is a built-in view.

mdm-adph
4 Jan 2008, 2:49 PM
Thanks for the start, I quickly hacked it up a bit to work with Ext 2.x. With more time it would make a good case to convert to a plugin instead of an extension.

Also, looks like ($VIMPeopleByLastName) is a built-in view.

Glad to see it worked! Glad to hear that view worked, too -- apparently I'm not using the custom one my uppers have told me to use... :D

Episode1
10 Jan 2008, 11:23 PM
Works great with Firefox! But has anybody got the NABPicker working in IE6 ?

mdm-adph
11 Jan 2008, 7:17 AM
I'm using it in IE6 right now -- this was actually a requirement for the project at my firm. What specific errors are occuring?

Episode1
11 Jan 2008, 7:45 AM
I tried to use it inside a form added to a BasicDialog. Works with no problems in Firefox, but IE6 does not show the ComboBox... without any error message... only blank area in the dialog.
[CODE]
dialogForm = new Ext.form.Form({});

dialogForm.add(np = new Ext.ux.form.NABPicker());

dialog = new Ext.BasicDialog('edit-dlg',{autoCreate: true, title: 'E-Mail Adressat ausw

mdm-adph
11 Jan 2008, 12:35 PM
I admit I'm no Ext-expert, but I don't know how it's appearing in Firefox at all -- there's no reference towards your form inside the dialog object.

The NABPicker is being rendered in IE, just outside the window object -- want to try creating your window markup beforehand and tell me what it looks like? I got it to work that way.

Episode1
14 Jan 2008, 2:21 AM
Hmmm:-? I'm creating the dialog without markup...

The codeline

dialogForm.render(dialog.body);

renders my form with the NABPicker into my dialog. Until now this works... perhaps we ask the expierenced JS programmers, whether I do something wrong?