[FIXED] [#886] [3.3] Error setting Checkbox BoxLabel property

  1. #1

    [FIXED] [#886] [3.3] Error setting Checkbox BoxLabel property

    When I try to set the BoxLabel on a Checkbox using javascript I get the following error:

    Uncaught ReferenceError: boxLabel is not defined
    Ext.form.Checkbox.override.setBoxLabel @ ext.axd?v=19368:7759
    Window2_ShowAndChangeLabel @ testboxlabel.aspx:7
    fire @ ext.axd?v=19368:11885
    doFireEvent @ ext.axd?v=19368:12422
    prototype.doFireEvent @ ext.axd?v=19368:33397
    fireEventArgs @ ext.axd?v=19368:12392
    fireEvent @ ext.axd?v=19368:12366
    Ext.define.fireHandler @ ext.axd?v=19368:109038
    Ext.define.onClick @ ext.axd?v=19368:109027
    fire @ ext.axd?v=19368:11885
    Ext.define.fire @ ext.axd?v=19368:18703
    Ext.define.publish @ ext.axd?v=19368:18679
    Ext.define.doDelegatedEvent @ ext.axd?v=19368:18729
    Ext.define.onDelegatedEvent @ ext.axd?v=19368:18716
    Ext.Function.ExtFunction.bind.method @ ext.axd?v=19368:4400
    It seems the problem is in the @source core/form/Checkbox.js file:
        setBoxLabel : function (label) {
            this.boxLabel = label;        
            
            if (this.rendered) {
                if (this.boxLabelEl) {
                    this.boxLabelEl.setHtml(label);
                    this.innerWrapEl[boxLabel ? "removeCls" : "addCls"](this.noBoxLabelCls);
                    this.updateLayout();
                } else {            
                    this.boxLabelEl = this.bodyEl.createChild({
                        id: this.id + "-boxLabelEl",
                        "data-ref" : "boxLabelEl",
                        tag: "label",
                        "for"    : this.el.id,
                        cls     : this.boxLabelCls,
                        html    : this.boxLabel
                    });
    
    
                    this.applyBoxLabelCss();
                }
            }
        }
    });
    
    // @source core/form/CheckboxGroup.js
    Here is a test case for the problem:
    <%@ Page Language="C#" %>
    
    <!DOCTYPE html>
    
    
    <script runat="server">
    
    
    </script>
    <ext:XScript ID="StudentStatsDisplayScripts" runat="server">
            <script type="text/javascript">
    
    
                var Window2_ShowAndChangeLabel = function (sender) {
                    #{Window2}.show();
                    #{chkBox1}.setBoxLabel("Also causes an error...");
                }
    
    
                var Window2_ShowAndSetNote = function (sender) {
                    #{Window2}.show();
                    #{chkBox1}.setNote("Causes an error...");
                }
    
    
            </script>
    </ext:XScript>
    
    
    <html>
    <head runat="server">
        <title>setBoxLabel error- Ext.NET Examples</title>
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server">
            </ext:ResourceManager>
    
    
            <p>
                <ext:Button
                    ID="Button1"
                    runat="server"
                    Text="Set BoxLabel">
                    <Listeners>
                        <Click Fn="Window2_ShowAndChangeLabel" />
                    </Listeners>
                </ext:Button>
                <ext:Button
                    ID="Button2"
                    runat="server"
                    Text="Set Note">
                    <Listeners>
                        <Click Fn="Window2_ShowAndSetNote" />
                    </Listeners>
                </ext:Button>
    
    
            </p>
    
    
    
    
            <ext:Window
                ID="Window2"
                runat="server"
                Icon="House"
                Title="Click Listener"
                Hidden="true"
                X="275"
                Y="150">
                <Items>
                    <ext:Checkbox runat="server" ID="chkBox1" BoxLabel="Inital Text"
                        Checked="true">
                    </ext:Checkbox>
    
    
                </Items>
            </ext:Window>
    
    
        </form>
    </body>
    </html>
    I am using a build of 3.2 that was downloaded from the repository on 8/17/2015. If that helps trace the issue.

    Regards
    Last edited by Daniil; Aug 28, 2015 at 12:19 PM. Reason: [FIXED] [#886] [3.3]
  2. #2
    Hi @tnwheeler,

    Thank you for the report!

    Created an Issue:
    https://github.com/extnet/Ext.NET/issues/886

    Fixed in the revision 6552 (trunk). It goes to the 3.3 release.

Similar Threads

  1. [CLOSED] CheckBox BoxLabel
    By cwolcott in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Oct 09, 2012, 4:04 PM
  2. [CLOSED] Ext.net v2 Beta release: Checkbox BoxLabel property is
    By supera in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Mar 19, 2012, 1:01 PM
  3. Replies: 7
    Last Post: Sep 20, 2010, 10:06 PM
  4. Replies: 1
    Last Post: Aug 07, 2009, 12:56 AM
  5. [INVALID] CheckBox BoxLabel?
    By Timothy in forum Bugs
    Replies: 3
    Last Post: Jun 24, 2008, 5:43 AM

Tags for this Thread

Posting Permissions