This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes HTML, CSS and JavaScript and the fly likes object doesn't support the property or method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "object doesn Watch "object doesn New topic
Author

object doesn't support the property or method

deva siva
Ranch Hand

Joined: Apr 29, 2005
Posts: 37
Hi
i have a main window, when i click popups on this window its opens a new window(it is a modalDialog window).on this there is one more link named export, when we click that export button that, the content of the popup window will be downloaded in pdf format. it is working fine, now my question is.when we click export its ask dilog window like open/save/cancel. when we click open buton that document will be opend successfuly in pdf format. NOw when we click save button the document was saved successfully in given path but back end its gives a Internet explorer script error like "object doesn't support the property or method"

here when we click export button its call saveas.jsp file thru java script function like

function export
{
s=window.showModalDialog(saveas.jsp, "export", 'set the requird properties here');
if (s)
document.location.replace(s);
}

the saveas.jsp file contains options like in which format document download like 1. pdf 2. excel the user select choose the one option and click ok button its calls download.jsp file

the saveas.jsp file contain these below function.
function down
{
var downLoadURL="<%=request.getContextPath()%>"+"/Download.jsp";
var pdf=downLoadURL+"?reportName="+temp_baag+"&format="+doption;
window.returnValue=pdf;
self.close();
}
here when we are using window.returnValue = pdf, then the following location is going back to calling window.
from that window to iam using documet.location.replace(pdf);

suppose iam using document.location.replace(PDF) is using at the place of window.returnValue=pdf, then iam not getting that object doesn't support error but when we use document.location.replace(pdf) its opens in new browser window, but our client not needed to open extra window.
so can u help me there is any solution to download documet with out opend new window or how to solve the above error.

so help me ass soon as possible.

Thanking for Advance.
deva
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You can not create a modal object and try to replace the current window's location with it.

Why don't you just do:

document.location.href="yourSavAsPage.jsp";

That will open up the pdf for them to view/print and it will not open up a new window. They can use their back button to get back to the page they were on.

I would reccomend not using a modal window for a pop up to view a document. You probably should just use a trad. pop up window.

Eric
deva siva
Ranch Hand

Joined: Apr 29, 2005
Posts: 37
hi Eric,

iam using document.location.href = "myjsp" page, but still its opened in new window, and also get same error.(object doesnot support).

so can u pls give me suggestion.

Thanks
deva
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: object doesn't support the property or method