Link to home
Start Free TrialLog in
Avatar of IT79637
IT79637Flag for United States of America

asked on

How to Control Loading of frames.

Hi Experts,

I have written a automation server in Delphi .  The server controller is written in html and uses VBScript to launch the server and perform method calls.  Data is pass to/from the server through parmeters. This works great. Code section below shows how the server is created and an example of a method call.

The problem I am trying to solve is to make the automation server PERSISTENT WHEN THE WEB PAGE REFRESHES and BETWEEN DIFFERENT PAGES.

Question: What do I need to do with the frameset and frame tags to make the hidden frame load ONCE when I laundh IE6 and remain persistent, but allow the visible frame to reload/refresh continuously?

Since html and VBScript is stateless, each page refresh or new page causes the server do shut down and restart.

I am attempting to use framesets and frames to solve this problem. On my web page I have defined two frames:
1. One frame is visible and the content displayed is allowed to change by page refresh (validate data)  or displaying a new page.
2. Second frame is hidden and I want it to be persistent  until I close the IE6

In the code section, the "Create" is in the hidden frame. I want this to be persistent.  The "Execute Method" is an attempt to get the handle of the server created in the "Create" (hidden frame) and assign the handle to mySrvObj in the "Execute Method" which is visible.  First I test is mySrvObj exists.

If mySrvObj exists, then  I execute the method.
If mySrvObj does ntoesist: Set mySrvObj = parent.hide.MasterSrvObj

This is an attempt to get the handle of the server from the hidden frame.

The URL below is a 7 second, 4.45 MB, avi video showing the server shutting down and launching each time IE6 Page Refresh button is clicked.  This is the problem I am trying to solve.

http://rapidshare.com/files/135003783/NonPersistentServer.avi

Thanks much.





Create: 
Set MasterSrvObj = CreateObject("ImageDisplay.ImageDisplayInterface")
 
This is in the hidden frame.
 
Execute Method:
if not isobject(mySrvObj) then
  	Set mySrvObj = parent.hide.MasterSrvObj
end if   
iResult = mySrvObj.UnBusyInvoice(vDocID, vStaus)
This is in the visible frame.

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of scrathcyboy
scrathcyboy
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of IT79637

ASKER

I am able to successfully maintain a persistent automation server by using framesets and frames as follows:

I launch the the web page via the address bar.  
The code follows:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<FRAMESET rows="100%,*">
<FRAME name="MAIN"   src="mainpage.html" />
<FRAME name="HIDDEN" src="ServerControl.html" />
</FRAMESET>
</html>

All of the web pages will have to be set up as above in order to maintain a persistent automation
server for the duration of your browser session, if that is what you want.  This would include
pages that do not use the server.

My web pages are displayed in the frame=MAIN.  

The thread to the automation server is in frame=HIDDEN:
The code follows:

<SCRIPT Language="VBScript">
if not isobject(MasterSrvObj) then
  Set MasterSrvObj = CreateObject("ImageDisplay.ImageDisplayInterface")
end if
</SCRIPT>


To access the server from frame=MAIN. I do the following:

This code gets the handle to the server:
  if not isobject(mySrvObj) then
        Set mySrvObj = parent.hidden.MasterSrvObj  <<--- This gets the servers handle.
  end if
 
This code executes a method call to the server:
  iResult = mySrvObj.WorkInvoice(vCompany, vInvType, vDocID, vStaus)
 
The link below is a movie showing the server remains persistent while I navigate to another web page and back again.

http://rapidshare.com/files/136572821/PersistentServer.avi

7.75 Meg Download, 15 seconds duration.
 
I am a very happy camper.

Thanks much for your patience and help!!!
Avatar of IT79637

ASKER

scrathcyboy,

I have not tried saving the handle to the server using a cookie.  Would you please post a few lines of code showing how to save the server's handle as a cookie and then retrieving it back when a new page is displayed.

Thank you.
There are many ways to use cookies on a server, and more than a few lines of code.  See these links --

www.powerasp.com/content/code-snippets/cookies.asp
www.thesitewizard.com/php/set-cookies.shtml
www.thesitewizard.com/javascripts/cookies.shtml
www.codewanker.com/codearticle17.htm
www.webcheatsheet.com/ASP/cookies.php

remember, ASP and PHP are on the server, javascript is on the client browser.
I think I answered this question satisfactorily as asked.  This questioner had 2 separate questions I replied to and was not happy with any help I gave him.  In future I will just ignore all questions from this person.
Avatar of IT79637

ASKER

Finding a solution to this problem was very difficult.  I previously posted the same question on e-e.com, but no one responded for several days.  In this post I restated the question a little different and did get a reply.

I will try storing the handle in a client side cookie and let you know how it goes.  That would make my page simpler since I don't have to deal with frameset and frames.
 

In retrospect, a better decision would have been to leave the question open and try he cookie solution.  I do appreciate him taking the time to reply. I did not mean to insult scrathcyboy, but since I have, I extend my personal apology to him.

Thank you for your response,
IT79637