Hi,
I think there is a bug in ComboBox.js of version 0.7.3 (didn't check with
0.8.x) which is triggered when a ComboBox does not have an item selected -
either after setting it up or after calling resetSelected() - and a
changeLocale event occurs. The following code is enough to reproduce the
error:
var testMenu = new qx.ui.form.ComboBox();
var testItem=new qx.ui.form.ListItem('test');
testMenu.add(testItem);
testMenu.addToDocument();
qx.locale.Manager.getInstance().setLocale('de');
whereas the following code does not give an error:
var testMenu = new qx.ui.form.ComboBox();
var testItem=new qx.ui.form.ListItem('test');
testMenu.add(testItem);
testMenu.addToDocument();
testMenu.setSelected(testItem);
qx.locale.Manager.getInstance().setLocale('de');
I think the locale change event tries to change the label string of a none
existing item.
The error message is:
item is null
var label = item.getLabelObject();
on line 1017 in ComboBox.js:
1004 /**
1005 * Return the formatted label text from the <code>ListItem</code>.
1006 * The formatter removes all HTML tags and converts all HTML entities
1007 * to string characters if the <code>ListItem</code> is identified as
1008 * HTML text or the mode is set to <code>"html"</code>.
1009 *
1010 * @type member
1011 * @param item {ListItem} The list item to format.
1012 * @return {String} The formatted text.
1013 */
1014 __defaultFormat : function(item)
1015
1015 {
1016 var valueLabel = item ? item.getLabel().toString() : "";
1017 var label = item.getLabelObject();
1018
1019 if (label != null)
1020 {
I think there should be a check for item!=null protecting the call to
item.getLabelObject() and an appropriate return if no item is selected.
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
------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel