PDA

View Full Version : find and combobox



AndrewY
23 Nov 2010, 4:11 AM
The use of find still confounds me.

If I have a component within a window and issue:


var myCombo = this.find('itemid','myCombobox');
console.log(myCombo);
I get the window's object of myCombobox and all its properties and methods.

If I then use:


myCombo.getValue();
or any other function, it returns undefined.

If I use:


console.log(myCombo.id);
or any other property, I get undefined.

Will some enlightened sage please bestow much needed light?

Condor
23 Nov 2010, 4:40 AM
It's:

var myCombo = this.find('itemId', 'myCombobox')[0];

AndrewY
23 Nov 2010, 5:03 AM
Ouch.

Thank you very much.

For some reason, the words "returns an array" just weren't sinking in.