PDA

View Full Version : [CLOSED] [2.2pre] InputMask is causing exception. Resolves only when removed.



michaeld
Apr 11, 2013, 3:21 AM
[E] Ext.EventManager.addListener(): Error adding "input" listener. The handler function is undefined.
log (message=
"[E] Ext.EventManager.ad... function is undefined.")ext.axd?v=5346 (line 12212)
Ext.Base.raise(err=Object { sourceClass=
"Ext.EventManager", sourceMethod=
"addListener", targetElement={...}, more...})ext.axd?v=5346 (line 11352)
addListener(element=Object { el={...}, dom=input#ctl00_cp_ctl23_captext-inputEl.x-form-field, id=
"ctl00_cp_ctl23_captext-inputEl", more...}, eventName=
"input", fn=
undefined, scope=Object { pluginConfig={...}, proxyId=
"ctl00_cp_ctl23_InputMask1", ptype=
"inputmask", more...}, options=Object { delay=
1})ext.axd?v=5346 (line 16409)
Ext.dom.Element#on(eventName=
"input", fn=
undefined, scope=Object { pluginConfig={...}, proxyId=
"ctl00_cp_ctl23_InputMask1", ptype=
"inputmask", more...}, options=Object { delay=
1})ext.axd?v=5346 (line 30519)
Ext.net.InputMask#initPasteEvent()ext.axd?v=5346 (line 146)
createSingle()ext.axd?v=5346 (line 15888)
Ext.util.Event#fire()ext.axd?v=5346 (line 15843)
Ext.net.MessageBus#continueFireEvent(eventName=
"afterrender", args=
[Object { id=
"ctl00_cp_ctl23_captext", plugins=[1], width=
54, more...}], bubbles=
undefined)ext.axd?v=5346 (line 174)
Ext.AbstractComponent#continueFireEvent()ext.axd?v =5346 (line 3379)
Ext.net.MessageBus#fireEventArgs(eventName=
"afterrender", args=
[Object { id=
"ctl00_cp_ctl23_captext", plugins=[1], width=
54, more...}])ext.axd?v=5346 (line 153)
fireEventArgs(ev=
"afterrender", args=
[Object { id=
"ctl00_cp_ctl23_captext", plugins=[1], width=
54, more...}])

Daniil
Apr 11, 2013, 4:21 AM
Hi @michaeld,

Thank you for the report, but I could not reproduce it with this example and the SVN trunk.
http://examples2.ext.net/#/Form/TextField/InputMask/

michaeld
Apr 24, 2013, 2:38 AM
<%@ Page Language="C#" %>
<script runat="server">
protected void Page_Load( object sender, EventArgs e ) {
}
protected void OnSubmit( object sender, DirectEventArgs e ) {
X.MessageBox.Show( new MessageBoxConfig() { Buttons = MessageBox.Button.OK, Message = "Test", Title = "Test" } );
}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="//www.w3.org/1999/xhtml">
<head runat="server">
<title>Test20</title>
</head>
<body>
<form id="f" runat="server">

<ext:Viewport ID="vp" runat="server" Layout="VBoxLayout">
<LayoutConfig>
<ext:VBoxLayoutConfig Align="Stretch" />
</LayoutConfig>
<Items>
<ext:FormPanel ID="UserF" runat="server" Width="400" Border="false" BodyCls="BodyFrame" DefaultButton="Submit">
<Items>

<ext:TextField ID="Zip" runat="server" MinLength="5" MaxLength="5" EnforceMaxLength="true" FieldLabel="Zip Code" AllowBlank="false" EmptyText="Your zip code" Width="380">
<Plugins>
<ext:InputMask ID="InputMask1" runat="server" Mask="99999" AlwaysShow="true" />
</Plugins>
</ext:TextField>

</Items>
<Buttons>
<ext:Button ID="Submit" runat="server" Text="Create User" Disabled="true">
<DirectEvents>
<Click OnEvent="OnSubmit" Method="POST" DisableCaching="true">
<EventMask ShowMask="true" MinDelay="500" Msg="Creating User..." />
</Click>
</DirectEvents>
</ext:Button>
</Buttons>
<Listeners>
<ValidityChange Handler="#{Submit}.setDisabled(!valid);" />
</Listeners>
</ext:FormPanel>
</Items>
</ext:ViewPort>
<ext:ResourceManager ID="rm" runat="server" CleanResourceUrl="true" ScriptMode="Development" InitScriptMode="Linked"
HideInDesign="true" GZip="true" />
</form>
</body>
</html>


I dropped off the trunk and installed the latest version of Ext.net 2.2 from nugget and still get an exception, now > raise [ext.axd] Line 11355 Script
Error adding "paste" listener. The handler function is undefined. in ctl00_cp_Zip-inputEl

michaeld
Apr 24, 2013, 2:41 AM
Example explorer is broken again trying to view source.

Daniil
Apr 24, 2013, 8:53 AM
Thank you for the example. It has been fixed in SVN.

Fix

Ext.net.InputMask.override({
pasteHandler : function (){
if(this.unmasked){
return;
}
var pos = this.validateMask(true);
this.getCmp().selectText(pos, pos);
}
});


Example explorer is broken again trying to view source.

I am not getting what you mean. Please clarify.