Apr 28, 2011, 6:16 PM
[CLOSED] IE9 and Button Listener problem - "Ext is undefined"
Hi people, im having a problem with a listener in IE9, here is its detail...
* I have page A and page B.
* Page B is opened in a window Page A has. The window is called "windowPopUp".
* Page B has a javascript function that closes its parent's "windowPopUp". This function is called "closePage()".
* Page B also has 2 buttons:
- The first one works with the OnClientClick() event and calls the "closePage()" function. This one, works fine.
- The second one works with a listener and calls the "closePage()" function. This one gives me an "Ext is undefined" exception.
Im posting images and the code of each page.
The listener works fine in Firefox 4, IE8 and IE9 Compat.View
Thanks in advence.
Pic of error.
Page A Code
* I have page A and page B.
* Page B is opened in a window Page A has. The window is called "windowPopUp".
* Page B has a javascript function that closes its parent's "windowPopUp". This function is called "closePage()".
* Page B also has 2 buttons:
- The first one works with the OnClientClick() event and calls the "closePage()" function. This one, works fine.
- The second one works with a listener and calls the "closePage()" function. This one gives me an "Ext is undefined" exception.
Im posting images and the code of each page.
The listener works fine in Firefox 4, IE8 and IE9 Compat.View
Thanks in advence.
Pic of error.
Page A Code
<%@ 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>
<script runat="server">
private Ext.Net.Window _popup;
public Ext.Net.Window popup
{
get
{
if (_popup == null)
{
_popup = new Ext.Net.Window { ID = "windowPopup" };
Controls.Add(_popup);
}
return _popup;
}
set { _popup = value; }
}
protected void Page_Load(object sender, EventArgs e)
{
// Doing this to make the popup usable
this.LoadPopUp();
}
private void LoadPopUp()
{
this.popup.AutoShow = false;
this.popup.Collapsible = false;
this.popup.Resizable = false;
this.popup.Draggable = false;
this.popup.Closable = false;
this.popup.Modal = true;
this.popup.Height = 355;
this.popup.Width = 640;
this.popup.CloseAction = Ext.Net.CloseAction.Close;
this.popup.Hide();
}
[DirectMethod]
public void LoadNewPage()
{
this.popup.LoadContent(new Ext.Net.LoadConfig("PageB.aspx", Ext.Net.LoadMode.IFrame, true));
this.popup.Show();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server"></ext:ResourceManager>
<ext:ViewPort ID="ViewPort1" runat="server" Layout="Fit" MonitorResize="true">
<Items>
<ext:Panel ID="pnlPrincipal" ButtonAlign="Center" AutoScroll="true" Width="1260" Frame="true" runat="server">
<Items>
</Items>
<Buttons>
<ext:Button ID="btnLoadPage" runat="server" Width="70" IconAlign="left" Text="Nueva"
Icon="Add">
<Listeners>
<Click Handler="Ext.net.DirectMethods.LoadNewPage()" />
</Listeners>
</ext:Button>
</Buttons>
</ext:Panel>
</Items>
</ext:ViewPort>
</form>
</body>
</html>
Page B Code<%@ 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>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
}
</script>
<script language="javascript" type="text/javascript">
function closePage() {
window.parent.windowPopup.hide();
window.parent.windowPopup.clearContent();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server"></ext:ResourceManager>
<ext:ViewPort ID="ViewPort1" runat="server" Layout="Fit" MonitorResize="true">
<Items>
<ext:Panel ID="pnlPrincipal" Icon="User" ButtonAlign="Center" AutoScroll="true" Width="1260" Frame="true" runat="server">
<Items>
</Items>
<Buttons>
<ext:Button ID="btnClose" Icon="Cross" Width="70" runat="server" OnClientClick="closePage();" Text="Close using OnClient Click"/>
<ext:Button ID="btnClose2" Icon="Cross" Width="70" runat="server" Text="Close using Listener">
<Listeners>
<Click Handler="closePage()" />
</Listeners>
</ext:Button>
</Buttons>
</ext:Panel>
</Items>
</ext:ViewPort>
</form>
</body>
</html>
Last edited by Daniil; Apr 29, 2011 at 5:09 AM.
Reason: [CLOSED]