PDA

View Full Version : [CLOSED] Ext.form.Hidden.xtype is different in debug vs release mode



jchau
May 22, 2013, 2:57 PM
In debug mode, Ext.form.Hidden.xtype returns "hiddenfield". In release mode, Ext.form.Hidden.xtype returns "hidden". We understand both xtypes are valid but this caused issue because we had a line of code that targeted "hiddenfield" and not "hidden". So when our application is released, stuff got broken. We will change our code to check for both hiddenfield and hidden, but can you tell us why they are different between debug and release? And if there are more things like that.

Vladimir
May 22, 2013, 3:24 PM
Ext.Net HiddenField class uses one xtype value only


public override string XType
{
get
{
return "hiddenfield";
}
}


For me, xtype always the same in Debug and Release mode. I guess that the issue is not related with Ext.Net

jchau
May 22, 2013, 3:42 PM
It's the ExtJS files but when I look at Sencha.com's examples, Ext.form.Hidden.xtype is "hiddenfield". Maybe this is a Ext 4.2.1 issue.

Daniil
May 23, 2013, 4:18 AM
Hi @jchau,

Could you, please, provide us with a test case?

jchau
Mar 20, 2014, 2:09 PM
We are now seeing the same issue with checkboxfield vs checkbox. To reproduce, go to your example explorers. In browser console (firebug or chrome or IE developer tool), check 'Ext.form.Checkbox.xtype'. It says "checkbox". Switch example explorers to Debug Mode. Check 'Ext.form.Checkbox.xtype' again. It now says "checkboxfield". We have code that checks the xtype of a component. We now check for both checkbox and checkboxfield but it worries me that there can be other xtypes that may say different things base on debug vs release. It can lead to bugs that wont be caught until product goes live into production.

Daniil
Mar 20, 2014, 3:38 PM
That is interesting.

I think you shoud use the isXType method.
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.AbstractComponent-method-isXType

These both statements return true in both the ScriptModes - Release and Debug.

App.Checkbox1.isXType("checkbox");
App.Checkbox1.isXType("checkboxfield")