[CLOSED] Readonly issue

  1. #1

    [CLOSED] Readonly issue

    Hi

    We had some issues with setting fields readonly - I saw similar posts and I am not sure if it is solved already.

    Issue is related to Ext.net override of setReadOnly for form field

    Ext.net
    setReadOnly : function (readOnly) {
            if (this.rendered) {
                this.el.dom.setAttribute("readOnly", readOnly);
                this.el.dom.readOnly = readOnly;
            } else {
                this.readOnly = readOnly;
            }
        }
    Ext.js

        
    setReadOnly : function(readOnly){
            if(this.rendered){
                this.el.dom.readOnly = readOnly;
            }
           this.readOnly = readOnly;
        },
    As you can see Ext.net override is not updating readOnly property for field based on passed value if field is rendered.
    Last edited by Daniil; Oct 05, 2011 at 10:51 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Could you provide a sample where it's a problem?
  3. #3
    Sorry if this was not clear enough.
    Problem is that we can't determine if field is read only or not using its readOnly property.

    Here you can see that txtField.readOnly property is always true.

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <ext:ResourceManager runat="server" ID="rm" />
            <ext:Button runat="server" ID="btnTest" Text="set Text1 readonly = true">
                <Listeners>
                    <Click Handler="txtField.setReadOnly(true);txtField2.setValue(txtField.readOnly);" />
                </Listeners>
            </ext:Button>
            <ext:Button runat="server" ID="Button1" Text="set Text1 readonly = false">
                <Listeners>
                    <Click Handler="txtField.setReadOnly(false);txtField2.setValue(txtField.readOnly);" />
                </Listeners>
            </ext:Button>
            <ext:TextField LabelWidth="300" FieldLabel="Text 1" runat="server" ID="txtField"
                ReadOnly="true" />
            <ext:TextField LabelWidth="300" runat="server" ID="txtField2" ReadOnly="true" FieldLabel="Text 1 ReadOnly value" />
        </div>
        </form>
    </body>
    </html>
  4. #4
    We are going to just remove our method, because it was added when there was no .setReadOnly() in ExtJS.

    I will commit the change right now.
  5. #5
    Thanks for helping with this.
  6. #6
    Fixed in SVN, revision #3728.

    Please update from SVN or use the .getReadOnly() method to determine read-only status.

    Thanks for the report.

Similar Threads

  1. [CLOSED] Combobox readonly
    By gidi in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Feb 29, 2012, 3:22 PM
  2. [CLOSED] Calendar - readOnly ??
    By ndotis in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: May 18, 2011, 8:01 PM
  3. [CLOSED] HtmlEditor ReadOnly
    By methode in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 10, 2009, 5:18 AM
  4. Replies: 2
    Last Post: Jun 17, 2009, 12:48 PM
  5. Replies: 2
    Last Post: Dec 24, 2008, 6:17 AM

Tags for this Thread

Posting Permissions