How do I run another web object in a new window?

Aimee

New Member
I am trying to run a second web object (using: run-web-object) from my current page but it is appearing in the same window above the first object.
How can i get the second object to either replace the current one OR appear in a seperate window?
 

Robert

New Member
>I am trying to run a second web object (using: run-web-object)
>from my current page but it is appearing in the same window
>above the first object.

Aimee, you want to generate two pages on a single request? This can't be done on a single http request, that's just the way http works.

But you can get your front end to do two requests on a single user click (hyperlink or submit). For this you must use javascript, instead of the run-web-object. If you want to get two pages in two separate windows or frames, the targets and requests must originate from the client side, as it's the client side that will display the result of these requests.

>How can i get the second object to either replace the current
>one OR appear in a seperate window?

You have two solutions:
1. When the user requests the first page you use a javascript to request the second page at the same time.
2. The user requests the first page; this page is returned and, when loaded, automatically (through javascript) requests the second page, either to replace the page loaded of to open in a different (or new) window or in a different frame.

Solution 1 will look like this below
(the method used is form submition and opening 2nd page to new window):
<html><head>
[....]
<script language="javascript">
function getPages() {
window.open ("newWindow", "otherPage.r", "otherParameters");
document.mainForm.submit();
}
</script>
</head>
<body>
[....]
<form name="mainForm" action="MainPage.r" method="POST">
[your fields here....]
</form>
[......]
</html>


OR Solution 2 will contain the following on the main Page
(this opens a new window):
<html><head>
[....]
<script language="javascript">
function getOtherPage() {
window.open ("newWindow", "otherPage.r?param1=abc&param2=123", "newWindowParameters");
</script>
</head>
<body onLoad="getOtherPage();">
[....]
</html>

Alternatively, your function could do a form.submit() with the <form .... target="_NEW"> instead of a window.open.

If you are not familiar with any of these functions check the http://developer.netscape.com site or the http://msdn.microsoft.com site for on-line references.

HTH

Robert
 

Robert

New Member
Sorry, for solution 1 to run the script you must add:

<form name="mainForm" action="MainPage.r" method="POST">
[your fields here....]
<input type="button" value="Continue" onClick="getPages()">
</form>

Also for an other alternative in solution 2 check the replace function (javascript).
 
Top