[CLOSED] Panel.getBody problem

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] Panel.getBody problem

    Hi,

    I recently took updates which I haven't done for a long time and I get a JS error when calling Panel.getBody(). The error is "self is undefined". I use IFrames a lot (MVC application).

    The previous implementation of that method was working just fine:

    getBody : function () {
            if (this.iframe) {
                return this.iframe.dom.contentWindow;
            }
    Regards,
    Tadeusz
    Last edited by Daniil; Oct 19, 2010 at 2:01 PM. Reason: [CLOSED]
  2. #2
    Hi Tadeusz,

    Which browser is this issue happening in?

    Can you post some which demonstrates how to reproduce?
    Geoffrey McGill
    Founder
  3. #3
    Hi,

    It happens in FireFox 3.6.10 and it doesn't happen in IE 8. It may me take a week or two to prepare a sample application as we have quite a lot of going on. I have restored the previous version of the method for now and it works just fine.

    
    Ext.Panel.override(
    {
        getBody: function ()
        {
            if (this.iframe)
            {
                return this.iframe.dom.contentWindow;
            }
    
            return Ext.get(this.id + "_Content") || this.body;
        }
    });
    -Tadeusz
  4. #4
    Run a by alerting out "this.id", then post the value here.

    Example

    alert(this.id);
    Geoffrey McGill
    Founder
  5. #5
    Quote Originally Posted by tdracz View Post
    Hi,

    It happens in FireFox 3.6.10 and it doesn't happen in IE 8. It may me take a week or two to prepare a sample application as we have quite a lot of going on. I have restored the previous version of the method for now and it works just fine.

    
    Ext.Panel.override(
    {
        getBody: function ()
        {
            if (this.iframe)
            {
                return this.iframe.dom.contentWindow;
            }
    
            return Ext.get(this.id + "_Content") || this.body;
        }
    });
    -Tadeusz
    Hi Tadeusz,

    Maybe you would be able to create a new simple example instead of simplification of your existing code.
    Like this:

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!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>Ext.Net Example</title>
        <ext:ResourcePlaceHolder runat="server" />
    
        <script type="text/javascript">
            Ext.Panel.override({
                getBody: function ()
                {
                    if (this.iframe)
                    {
                        return this.iframe.dom.contentWindow;
                    }
                }
            });
        </script>
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager runat="server" />
        <ext:Panel ID="Panel1" runat="server" >
            <AutoLoad Mode="IFrame" Url="Test.aspx"/>
        </ext:Panel>
        <ext:Button runat="server" Text="Click me">
            <Listeners>
                <Click Handler="alert(Panel1.getBody().self.id);" />
            </Listeners>
        </ext:Button>
        </form>
    </body>
    </html>
  6. #6
    Hi Daniil,

    My case is a bit different. I call the dialog's show() method and then immediately getBody() (simplifying). That is to defer some dialog setup if the dialog is being loaded for the first time or do the setup right away if the dialog is already loaded. Anyway, in my case, the panel's id id editTagDialog and getBody().self.id returns 'ext-gen2'.

    Regards,
    Tadeusz
  7. #7
    Actually my panel is a window, if that changes anything:

    <ext:Window ID="editTagDialog" runat="server" Title="" Width="300" Height="190" Hidden="true" Modal="true" ButtonAlign="Right" Minimizable="false IDMode="Explicit">
    	<AutoLoad Url="~/Tags/EditTagForm" Mode="IFrame" TriggerEvent="show" ShowMask="true" />
    	<Buttons>
    ...
    	</Buttons>
    </ext:Window>
  8. #8
    Hi,

    I still cannot reproduce the issue.

    Please clarify did you try the following thing? What is the result?

    Quote Originally Posted by geoffrey.mcgill View Post
    Run a by alerting out "this.id", then post the value here.

    Example

    alert(this.id);
  9. #9
    Hi,

    this.id returns 'editTagDialog' while getBody().self.id returns 'ext-gen2'.

    Regards,
    Tadeusz
  10. #10
    Hi,

    We will revert old implementation of getBody method soon. Just need to perform some testing
Page 1 of 2 12 LastLast

Similar Threads

  1. [CLOSED] Problem with collapsible panel.
    By feanor91 in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Jun 13, 2012, 1:33 PM
  2. [CLOSED] Collapsible Panel problem
    By sailendra in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: May 18, 2012, 11:43 AM
  3. Replies: 0
    Last Post: Mar 02, 2011, 8:06 AM
  4. [CLOSED] [1.0] getBody() Error In IE8
    By rcaunt in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Oct 14, 2010, 2:58 PM
  5. [CLOSED] tab panel problem
    By LeeTheGreek in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: May 20, 2010, 9:58 AM

Posting Permissions