PDA

View Full Version : [CLOSED] Disabled controls bug



aisi_it_admin
Oct 02, 2012, 7:56 AM
Hello, disabled controls seems to sent nothing to the server, example:


<ext:TextField runat="server" ID="txt1" Disabled="True"/>
<ext:TextField runat="server" ID="txt2"/>
<ext:Button runat="server" Text="Copy from second to first">
<Listeners>
<Click Handler="#{txt1}.setValue(#{txt2}.getValue());"></Click>
</Listeners>
</ext:Button>
<ext:Button runat="server" Text="Display Value of First on server" OnDirectClick="btn2_click">

</ext:Button>


protected void btn2_click(object sender, DirectEventArgs e)
{
X.Msg.Alert("This is always empty", txt1.Text).Show();
}

Fill something in second textbox and click first and second button.

Applies to Textfield and Combo

I think this is a bug, nearly sure that it worked fine in ext 1.4

Vladimir
Oct 02, 2012, 8:55 AM
First, according W3C standard, disabled input elements are not submitable
http://www.w3.org/TR/html401/interact/forms.html#h-17.12.1
http://www.w3schools.com/tags/att_input_disabled.asp

Ext.Net direct event changes such behaviour, disabled elements are submitable bu default
Here is my test case and it works correctly (i see the value in message)


<%@ Page Language="C#" %>
<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET Examples</title>


<script runat="server">
protected void btn2_click(object sender, DirectEventArgs e)
{
X.Msg.Alert("This is always empty", txt1.Text).Show();
}
</script>
</head>
<body>
<form runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />

<ext:TextField runat="server" ID="txt1" Disabled="True"/>
<ext:TextField runat="server" ID="txt2"/>
<ext:Button runat="server" Text="Copy from second to first">
<Listeners>
<Click Handler="#{txt1}.setValue(#{txt2}.getValue());"></Click>
</Listeners>
</ext:Button>
<ext:Button runat="server" Text="Display Value of First on server" OnDirectClick="btn2_click">

</ext:Button>
</form>
</body>
</html>


Therefore please ensure that you use latest code, update from 2.1 branch (http://svn.ext.net/premium/branches/2.1) and retest

aisi_it_admin
Oct 02, 2012, 9:07 AM
I'm on 2.0, 2.1 was not released yet, no?
Could that be a problem?

Daniil
Oct 02, 2012, 9:31 AM
Yes, v2.1 is not released, but you can get its sources from SVN:
http://svn.ext.net/premium/branches/2.1/