Home » Developer & Programmer » Forms » Close Web.show_document Automatically
Close Web.show_document Automatically [message #307145] Tue, 18 March 2008 00:02 Go to next message
Prasad01
Messages: 22
Registered: August 2007
Junior Member
Hi,

I have a requirement from a multi-record block, whenever user selects a record, it should open the file related to this record(pdf file) in a browser.
I know this can be done using Web.show_document.
But the problem is when user navigates to a new record and the file doesnot exist for the new record, then the first Web.show_document should close automatically.
How can this be achived?
Thanks in Advance
Prasad
Re: Close Web.show_document Automatically [message #307471 is a reply to message #307145] Tue, 18 March 2008 23:52 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Have you considered testing whether the file exists BEFORE calling 'web.show_document' and if it does not then invoke 'web.show_document' uses a dummy file that says "File not found"?

David
Re: Close Web.show_document Automatically [message #307481 is a reply to message #307471] Wed, 19 March 2008 00:10 Go to previous messageGo to next message
Prasad01
Messages: 22
Registered: August 2007
Junior Member
Even if I check it before calling Web.Show_document, it wont help.
Because lets say the first record has the file, so I lauch the file in a new browser.
Now the user selects 2nd record, this does not have the file, so I have to close the first record's browser.
Re: Close Web.show_document Automatically [message #307482 is a reply to message #307145] Wed, 19 March 2008 00:12 Go to previous messageGo to next message
Prasad01
Messages: 22
Registered: August 2007
Junior Member
Also to add comment about dummy file that says "File not found".
The user wnats to launch the browser only when the file exists, so it wont help to lauch a browser saying "File not found".
Re: Close Web.show_document Automatically [message #307501 is a reply to message #307482] Wed, 19 March 2008 00:47 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I googled 'close browser oracle forms' and found http://oracle.jacoulter.net/howto/close_browser.html which says to use "webshow.document('close.html');" to close a Form's browser, but it may close the 'last' browser. You will have to test it. It may also, of course, close the 'current' bwoser which will be the Forms browser as you will have it active when the file is not found.

I googled 'find and close browser window' and found http://blogs.x2line.com/al/articles/350.aspx

Does it help?

David
Re: Close Web.show_document Automatically [message #307502 is a reply to message #307501] Wed, 19 March 2008 00:52 Go to previous messageGo to next message
Prasad01
Messages: 22
Registered: August 2007
Junior Member
Thnaks for the info.
I am already using close.html as mentioned.
The code I am using:
<html>
<head>
<script language="javascript">
function closeit()
{
win = top;
win.opener = top;
win.close ();
}
</script>
</head>
<body onload="closeit()">
close window
</body>
</html>

The problem in this I want to specify the Window name to close, and I dont know how to do that in above code.
Or I want to specify a wildcard address to close like
Http:\\mysite* which would close all browsers with these addresses.
Re: Close Web.show_document Automatically [message #307514 is a reply to message #307502] Wed, 19 March 2008 01:08 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
The latter will certainly close your Forms browser session. Not what you want!!

I googled 'find window name' and found http://msdn2.microsoft.com/en-us/library/ms633499(VS.85).aspx

I think you will have to 'think Microsoft' to solve this problem. The answer will be out there. You may need to do a bit of Microsoft Window scanning to find the name that is used by your invoked display browser.

David
Previous Topic: Highlight rows based on criteria
Next Topic: no of rows in a block
Goto Forum:
  


Current Time: Sun Feb 09 22:15:33 CST 2025