PDA

View Full Version : Ext.Template not displaying in IE



rhorn
14 Dec 2012, 7:45 AM
I have a button that contains a menu (colormenu). The template for the colormenu will not display in IE (IE 9 standards 8 and 9). The button is a field within a container with the form layout. The form container is inside a panel with a vbox layout. When this panel is displayed only a menu button is displayed and when you hover over it the following error comes up in the developer console: "Unable to get value of the property 'on': object is null or undefined. ext-all-debug.js?v=12976:13091M, line 49336 character 21". Click on the button will cause the color menu to display. The code at the line given in above error:


if(!this.monitoringMouseOver){
Line 49336 ---> this.doc.on('mouseover', this.monitorMouseOver, this);

this.monitoringMouseOver = true;
}

Below is the code for the button:


{
xtype: 'button',
fieldLabel : 'Color',
menu : {
xtype : 'colormenu',
handler : function(picker, choice) {
Ext.fly('colorSample').setStyle('backgroundColor', '#' + choice);
me.wizard.metadata['color'] = choice;
}
},
data: me.wizard.metadata,
tpl: new Ext.Template(
'<div id="colorSample" style="border: 1px solid black; width: 15px; height: 15px; margin-left: 3px; background-color: #{color}">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Choose Color</div>')
}

mitchellsimoens
16 Dec 2012, 9:32 AM
What is me.wizard.metadata?

rhorn
16 Dec 2012, 11:24 AM
It is essentially a key value array that holds various pieces for data that are used by each page of the wizard. "me.wizard" is a pointer to the main wizard page that oversees traversal through all the pages within the wizard. Most of the values stored is JSON information that is used for the various stores, but there are primitive types as well (i.e color, name, description) . I'm trying to remember the exact setup we have on the back end. I think that when the wizard launches all these values are obtained from the DB and added to a JSON Map which is then passed to the wizard pages metadata variable. So me.wizard.metadata is a JavaScript representation of a Java JsonMap. FYI, in case you wish to know the back end is JavaEE (using the SEAM framework).