PDA

View Full Version : [CLOSED] java script error



elke.schreiber
May 03, 2013, 9:08 AM
Hi

I have a panel with an Iframe on my page. The url is set in code behind.
This produces a javascript error. Any idea what i can do against it?

the markeup:

<ext:Panel ID="PanelDocumentPreview" runat="server" Title="<%$ Resources:CUSTRocheImport, DocumentPreview %>"
Height="400" MinHeight="200" Width="520" Flex="1" Margins="0 5 0 0">
<Loader ID="Loader1" Url="" Mode="Frame" ShowMask="true" runat="server" />
</ext:Panel>

Daniil
May 03, 2013, 9:18 AM
Hi @elke.schreiber,


The url is set in code behind.

At which moment?

You might need to set up AutoLoad="false" for the Loader.

elke.schreiber
May 03, 2013, 12:15 PM
Hi @elke.schreiber,



At which moment?

You might need to set up AutoLoad="false" for the Loader.


thanks that helps.

But I have an a addition problem with the Iframe.
Sometimes I get following error.

Unhandled exception at line 2251, column 13 in http://localhost/CUST.Roche.Import.View/extnet/extnet-all-debug-js/ext.axd?v=40838
0x8000ffff - Microsoft JScript runtime error: Invalid calling object

It happens in the function and on the page i get "false".

I get the error since we have changed to ext.net 2.2 before it worked well.


Any idee?




loadFrame: function (options) {
.....

else {
target.iframe.dom.src = Ext.String.format("java{0}", "script:false");
window.frames[target.iframe.dom.name].location.replace(url);
this.beforeIFrameLoad(options);
}....

Daniil
May 03, 2013, 2:18 PM
Could you, please, provide a test case to reproduce the error?

elke.schreiber
May 04, 2013, 8:58 AM
Could you, please, provide a test case to reproduce the error?

this error happens on a complex page with many business functionality and data from a complex database structure.

Please try to help me without an example.
Can you tell me what you know about this error?

Thanks

Vladimir
May 05, 2013, 7:09 AM
this error happens on a complex page with many business functionality and data from a complex database structure.

We don't need business functionality, you have to remove any code unrelated with the issue
Is the issue reproducible in simple page?
Is the issue reproducible if the loader has any initial url (just I noticed that your loader has empty url)?

elke.schreiber
May 07, 2013, 9:57 AM
We don't need business functionality, you have to remove any code unrelated with the issue
Is the issue reproducible in simple page?
Is the issue reproducible if the loader has any initial url (just I noticed that your loader has empty url)?


Hi

I have tried to reproduce the error that I have since Version 2.2


Startpage:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestLoad.aspx.cs" Inherits="WebCsharp.TestLoad" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">

[Ext.Net.DirectMethod()]
protected void cmdLoad(object sender, EventArgs e)
{
Panel1.LoadContent("/Document.aspx");
}

[Ext.Net.DirectMethod()]
protected void cmdReset(object sender, EventArgs e)
{

Panel1.LoadContent("/LoadUsercontrol.aspx");
}

</script>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<div>
<ext:Panel ID="test" runat="server">

<Buttons>
<ext:Button ID="Button1" runat="server" Text="Load">
<DirectEvents>
<Click OnEvent="cmdLoad">
<EventMask ShowMask="true" />
</Click>
</DirectEvents>
</ext:Button>
<ext:Button ID="Button2" runat="server" Text="Reset">
<DirectEvents>
<Click OnEvent="cmdReset">
<EventMask ShowMask="true" />
</Click>
</DirectEvents>
</ext:Button>
</Buttons>
<Items>
<ext:Panel ID="Panel1" runat="server"
Height="400" MinHeight="200" Width="520" Flex="1" Margins="0 5 0 0">
<Loader ID="Loader2" Url="" Mode="Frame" ShowMask="true" runat="server" AutoLoad="false" />
</ext:Panel>


</Items>
</ext:Panel>
</div>
</form>
</body>
</html>

The Document.aspx --> the pdf is not special
LoadUsercontrol.aspx --> nothing specal


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Document.aspx.cs" Inherits="WebCsharp.Document" %>



<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
byte[] content = System.IO.File.ReadAllBytes(@"C:\Test.pdf");

Response.BinaryWrite(content);
Response.End();
}
</script>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>

</div>
</form>
</body>
</html>


hope you will find the error

Daniil
May 07, 2013, 3:39 PM
Thank you for a test case.

It looks we are facing the same issue as here.
http://www.digiblog.de/2011/08/ie9-bug-loading-pdfs-into-frames-using-javascript/

We committed the change to SVN. Please update and retest.

elke.schreiber
May 08, 2013, 6:12 AM
Thank you for a test case.

It looks we are facing the same issue as here.
http://www.digiblog.de/2011/08/ie9-bug-loading-pdfs-into-frames-using-javascript/

We committed the change to SVN. Please update and retest.


Thanks, we will test it.
But what I can say is that it also happens in Firefox.

Daniil
May 08, 2013, 10:19 AM
I can't reproduce it with FireFox. By the way, FireFox doesn't show a pdf correctly for me, it shows some "abracadabra". The same in Chrome.

How is it going for you?

elke.schreiber
May 12, 2013, 10:48 AM
I can't reproduce it with FireFox. By the way, FireFox doesn't show a pdf correctly for me, it shows some "abracadabra". The same in Chrome.

How is it going for you?


Hi Vladimir,

now I have downloaded from svn.
For IE it works now. Mozilla can't interprete the pdf.
May be my Resopnse object is a little bit to simple.

I will test it tomorrow in my solution and give you a feedback.

Thanks Elke

elke.schreiber
May 13, 2013, 2:19 PM
Hi Vladimir,

now I have downloaded from svn.
For IE it works now. Mozilla can't interprete the pdf.
May be my Resopnse object is a little bit to simple.

I will test it tomorrow in my solution and give you a feedback.

Thanks Elke

Hi Vladimir,

thanks for help.
Now it works on all pages.