Oct 26, 2016, 5:46 PM
RemoteValidation ExtraParam: Uncaught TypeError: Cannot read property 'getValue' of undefined. (Ext.NET 4.1.0)
Hello,
I'm using remote validation and hoping the DirectEvent will not submit any form data, only ExtraParams (Type="Load") but I receive the console message: 'Cannot read property 'getValue' of undefined'. Am I doing something wrong? (using Ext.NET 4.1.0)
The test code is taken from the example https://examples4.ext.net/#/Form/Val...te_Validation/
Tanks in advance,
I'm using remote validation and hoping the DirectEvent will not submit any form data, only ExtraParams (Type="Load") but I receive the console message: 'Cannot read property 'getValue' of undefined'. Am I doing something wrong? (using Ext.NET 4.1.0)
The test code is taken from the example https://examples4.ext.net/#/Form/Val...te_Validation/
Tanks in advance,
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
protected void CheckField(object sender, RemoteValidationEventArgs e)
{
string sParam1 = e.ExtraParams["Param1"];
if (sParam1 == "Valid")
{
e.Success = true;
}
else
{
e.Success = false;
e.ErrorMessage = "'Valid' is valid value only";
}
}
</script>
<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
<title>Remote Validation - Ext.NET Examples</title>
<link href="/resources/css/examples.css" rel="stylesheet" />
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:FormPanel
runat="server"
Title="Remote Validation Form"
BodyPadding="5"
Frame="true"
Width="500"
DefaultAnchor="100%">
<FieldDefaults>
<CustomConfig>
<ext:ConfigItem Name="LabelWidth" Value="250" Mode="Raw" />
<ext:ConfigItem Name="PreserveIndicatorIcon" Value="true" Mode="Raw" />
</CustomConfig>
</FieldDefaults>
<Items>
<ext:TextField ID="TextField1" runat="server" FieldLabel="Data 1" />
<ext:TextField ID="TextField2" runat="server" FieldLabel="Data 2" IsRemoteValidation="true">
<RemoteValidation OnValidation="CheckField" Type="Load">
<ExtraParams>
<ext:Parameter Name="Param1" Value="#{TextField1}.getValue()" Mode="Raw" Encode="true"/>
</ExtraParams>
</RemoteValidation>
</ext:TextField>
</Items>
</ext:FormPanel>
</form>
</body>
</html>