[CLOSED] [1.0] Dynamically added checkbox can not be set to checked initally

  1. #1

    [CLOSED] [1.0] Dynamically added checkbox can not be set to checked initally

    Dynamically creating a form with checkbox in it. Checked = true but checkbox renders unchecked. Script output also says value:false.

    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    
    <script runat="server">
    
        [DirectMethod()]
        public void CreateForm() {
            var win = new Ext.Net.Window() {
                Height=400,
                Width=450,
                Modal=true,
                Layout="fit",
                Title="Dynamic"
            };
    
            //create inner form panel
            var pnlForm = new Ext.Net.FormPanel() {
                ID = "pnlForm",
                Border = false,
                AutoScroll = true,
                RenderFormElement = false
            };
            win.Add(pnlForm);
    
            // name
            var txtName = new Ext.Net.TriggerField() {
                ID = "txtEditWidgetName",
                FieldLabel = "Name",
                AnchorHorizontal = "-20",
                MaxLength = 100,
                Text = "New Name"
            };
            pnlForm.Add(txtName);
            
            // checkbox
            var chkFlag = new Ext.Net.Checkbox() {
                ID = "chkFlag",
                FieldLabel = "Flag",
                Checked = true // doesn't seem to work
            };
    
            pnlForm.Add(chkFlag);
    
            this.resMgr.AddScript(win.ToScript(RenderMode.RenderTo, "form1"));
            
            
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <ext:ResourceManager runat="server" ID="resMgr">
        </ext:ResourceManager>
        <ext:Button runat="server" Text="Create Form" Icon="TableAdd">
            <Listeners>
                <Click Handler="Ext.net.DirectMethods.CreateForm();" />
            </Listeners>
        </ext:Button>
        </form>
    </body>
    </html>
    Last edited by geoffrey.mcgill; Jul 09, 2010 at 9:51 PM.
  2. #2
    Hi,

    Fixed. Please update from SVN

Similar Threads

  1. [CLOSED] How to set checkbox node has been checked?
    By gs_user in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Jun 21, 2012, 8:40 AM
  2. [CLOSED] Another way to check checkbox is checked ot not....
    By rosua in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jun 21, 2012, 5:39 AM
  3. [CLOSED] CheckBox.Checked is not getting set
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 01, 2011, 11:27 AM
  4. [CLOSED] [1.0] checkbox.checked not valorized
    By PoloTheMonk in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Apr 23, 2010, 4:32 AM
  5. Checked checkbox (Client)
    By Kaido in forum 1.x Help
    Replies: 0
    Last Post: Jul 13, 2009, 6:08 AM

Posting Permissions