PDA

View Full Version : [CLOSED] Compatibility issue [DEPRECATED][4.0][KeyMap]: Ext.KeyMap has been deprecated, use Ext.util.KeyMap.



Leonid_Veriga
Sep 04, 2012, 10:02 AM
Hello.

I included the compatibility layer in my project to correct my scripts. I am receiving dozens of errors "[DEPRECATED][4.0][KeyMap]: Ext.KeyMap has been deprecated, use Ext.util.KeyMap.". All these error are occured in the scripts, which are generated by Ext.Net.

Is this acceptable?

Daniil
Sep 04, 2012, 10:11 AM
Hi,

Please clarify what Ext.NET version do you use?

I was unable to reproduce this error online:
http://examples2.ext.net/#/Keys/KeyMap/BorderLayout_Regions_Toggle/
and using the same v2.1 example.

Leonid_Veriga
Sep 04, 2012, 10:41 AM
I am using Ext.Net 2.1. Also I included in my project 2 files from the compatibility pack (ext3-core-compat.js and ext3-compat.js from http://cdn.sencha.io/ext-3-to-4-migration-pack.zip). These 2 files generates this error.

Let me know if you need more information.

Best regards.

Daniil
Sep 04, 2012, 11:21 AM
Ok, thanks for the clarification.

Well, I think it just alerts to use Ext.util.KeyMap instead of Ext.KeyMap to avoid a breakage after removing these compatibility scripts. It should not be a real error, it should be just a warning.

Probably, we use Ext.KeyMap somewhere in Ext.NET. It should be replaced with Ext.NET. I was unable to reproduce this "deprecated" warning using my test case. Could you provide a sample? At least, a code snippet where you use KeyMap. It will allow us to quickly find where we use Ext.KeyMap.

Leonid_Veriga
Sep 04, 2012, 12:18 PM
Yes it is a warning message. Sorry for misleading you. Find the sample below. The warnings are appeared on page load. Also there are aditional warnings, when I try to exapnd combo boxes.



<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<script src="Scripts/ext3-core-compat.js" type="text/javascript"></script>
<script src="Scripts/ext3-compat.js" type="text/javascript"></script>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />

<ext:FormPanel runat="server">
<FieldDefaults>
<CustomConfig>
<ext:ConfigItem Name="LabelWidth" Value="120" Mode="Raw" />
</CustomConfig>
</FieldDefaults>
<Items>
<ext:ComboBox runat="server" Width="225" FieldLabel="Combo without container" />
<ext:FieldContainer runat="server" FieldLabel="Combo in container">
<Items>
<ext:ComboBox ID="ComboBox1" runat="server" Width="100" />
</Items>
</ext:FieldContainer>
</Items>
</ext:FormPanel>
</form>
</body>
</html>

Daniil
Sep 04, 2012, 1:36 PM
Thank you.

I think it is a bug within the compatibility scripts.

I just debugged, it throws these deprecation messages on this line:

map = me.map = new Ext.util.KeyMap(keymapCfg);

Also these compatibility scripts looks old.

I see "Updated May 27, 2011" here:
http://www.sencha.com/forum/showthread.php?124015-Ext-3-to-4-Migration

and "Updated October 10, 2011" here:
http://www.sencha.com/products/extjs/download/

Seems they just forgot to update the second first date, but, anyway, it is rather old.

According the dates I assume it is for ExtJS 4.0. Currently, Ext.NET v2.1 uses ExtJS 4.1.1.

However, I think you can still use these compatibility scripts, they are helpful. Just there is a possibility to get some wrong or not complete output according the difference between ExtJS 4.0 and 4.1.1.

Also your report leaded me to find "Ext.KeyNav" in our scripts. I think it should be replaced with "Ext.util.KeyNav". Thank you.

Leonid_Veriga
Sep 04, 2012, 1:59 PM
Thank you for rapid response.