• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

object doesn't support the property or method

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
reply
    Bookmark Topic Watch Topic
  • New Topic