[OPEN] [#1612] gh1567 override causes an exception if a checkbox is show()n before it's rendered

  1. #1

    [OPEN] [#1612] gh1567 override causes an exception if a checkbox is show()n before it's rendered

    Ext.Net version: 4.7.1

    Hello,

    This is a follow-up to https://forums.ext.net/showthread.php?62155. We just upgraded to 4.7.1 to receive the official fix, but we discovered an issue.

    If you have a hidden window with a checkbox, and you show() that checkbox before show()ing the window, an exception is thrown (and the window will remain hidden). Here's a repro:

    <%@ Page Language="C#"  %>
    <%@ 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">
        <ext:ResourceManager runat="server" ScriptMode="Debug" />
        <ext:Viewport runat="server">
            <Items>
                <ext:Window runat="server" ID="TestWindow" Hidden="true">
                    <Items>
                        <ext:Checkbox runat="server" ID="TestBox" FieldLabel="I am a checkbox" />
                    </Items>
                </ext:Window>
                <ext:Button runat="server" Text="Open window"
                            OnClientClick="#{TestBox}.setVisible('some condition' !== false); #{TestWindow}.show();"/>
            </Items>
        </ext:Viewport>
    </form>
    </body>
    </html>
    If you click the button you will get an Uncaught TypeError: Cannot read property 'setStyle' of undefined.

    The exception is thrown from the gh1567 override in the following line:
    me.innerWrapEl.setStyle('display', undefined);
    me is the checkbox, and me.innerWrapEl is undefined (presumably because the checkbox hasn't been rendered yet).

    Best regards,
    Raphael
  2. #2
    Hello, @ilogsdev02!

    Thanks for the report and easily reproducible test case!

    We've logged the issue after #1612 in github and will post an update here as soon as we get the fix merged to the code.
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 3
    Last Post: Nov 01, 2016, 1:17 AM
  2. Replies: 1
    Last Post: Jul 18, 2016, 5:52 PM
  3. Replies: 3
    Last Post: Feb 02, 2016, 11:15 PM
  4. [CLOSED] Override checkbox behavior
    By pawangyanwali in forum 2.x Legacy Premium Help
    Replies: 18
    Last Post: Jun 20, 2013, 7:33 AM
  5. [OPEN] [#93] NumericAxis labels rendered incorrectly
    By Stijn in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Dec 27, 2012, 5:44 AM

Posting Permissions