Hi Skar,

On Tue, 11 Aug 2009, skar wrote:

> Hi Fritz,
>> getLabel(), setLabel are methods to access the label of the SelectBox.
>> setUserData() and getUserData() are methods you can use with all/most
>> widgets (inherited).
>>
>> The idea is, to implement the old SelectBox-behaviour (with both a label and
>> an 'index' for each item) by using set/getUserData.
>>
>> I am not sure, that I like this, but it certainly works.

> Thanks. Using the label works now. You mean, use the data for storing
> the index?

Yes.

> However, if I set user data and then get it immediately back, I get
> "null". I'm using trunk version 19793. Probably a bug?

Hmm, works for me (with trunk 19765, but I don't think this is likely to
have been broken in between).

...

item.setUserData('index') = 'whatever';
var index = item.getUserData('index');

should set index to 'whatever'.

The parameter to set/getUserData() could be any other key as well ('index'
is just my choice for this example).

Cheers,
Fritz

-- 
Oetiker+Partner AG              tel: +41 62 775 99 03 (direct)
Fritz Zaucker                        +41 62 775 99 00 (switch board)
Aarweg 15                            +41 79 675 06 30 (mobile)
CH-4600 Olten                   fax: +41 62 775 99 05
Schweiz                         web: www.oetiker.ch

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to