Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE Refresh with CF Frames

Status
Not open for further replies.

modfather

MIS
Feb 15, 2000
75
US
I'm hoping someone can help me out. I'm not a web guru, by any means so please be gentle :)

I have a site developed in ColdFusion that uses frames. Traditionally, there would be be three frames (top, main, bottom), but some pages have up to 6 or 7 frames (some are hidden). (*I know now why frames stink! - but don't blame me, I didn't design it*) In any event, when I hit the "refresh" button in IE 6.0, the entire page is reloaded, and my default page is reloaded, not the page I was just on. For example: if I navigate to the "links" area, and hit my refresh button, it takes me back to my home page. If I right-click on the frame and hit "Refresh", that works fine.

Is there a way I can correct this problem? Also, it is interesting to note that Netscape works properly - however I notice that if I "double-click" the Refresh button in Netscape, it goes to the "home page" as well...

Any help would be EXTREMELY appreciated.

Thanks.
Steve
 
Microsoft and Netscape would tell you that this is a "feature", not a "problem".

You could possibly add a "refresh" button on the page itself, that would call javascript to refresh just the current frame...
Code:
   <script ...>
      function reloadFrame(){
              :
          window.location.reload();
      }
   </script>
but if the user hit the browser refresh button, you'd still have the same issue.

The only way I could see of preventing the behavior is to store the current page of each frame in a session variable or something. Then, if the frameset page were ever reloaded, you'd check for the values of those session variables and dynamically load the most recent pages in the frames.

Something like:
Code:
<CFAPPLICATION ... sessionmanagement=&quot;yes&quot; ...>

<CFSET sFrame1page = &quot;default_frame1page.cfm&quot;>
<CFSET sFrame2page = &quot;default_frame2page.cfm&quot;>
<CFSET sFrame3page = &quot;default_frame3page.cfm&quot;>

<CFLOCK timeout=&quot;10&quot; throwontimeout=&quot;No&quot; type=&quot;READONLY&quot; scope=&quot;SESSION&quot;>
    <CFIF IsDefined(&quot;session.frame1page&quot;)>
       <CFSET sFrame1page = session.frame1page>
    </CFIF>
    <CFIF IsDefined(&quot;session.frame2page&quot;)>
       <CFSET sFrame2page = session.frame2page>
    </CFIF>
    <CFIF IsDefined(&quot;session.frame3page&quot;)>
       <CFSET sFrame3page = session.frame3page>
    </CFIF>
              :
</CFLOCK>

<frameset rows=&quot;20%,40%,*&quot; framespacing=&quot;0&quot; frameborder=&quot;5&quot; border=&quot;5&quot;>
    <CFOUTPUT>
    <frame name=&quot;frame1&quot; src=&quot;#sFrame1page#&quot; marginwidth=&quot;10&quot; marginheight=&quot;10&quot; framespacing=&quot;0&quot; scrolling=&quot;auto&quot; frameborder=&quot;1&quot;>
    <frame name=&quot;frame2&quot; src=&quot;#sFrame2page#&quot; marginwidth=&quot;10&quot; marginheight=&quot;10&quot; framespacing=&quot;0&quot; scrolling=&quot;auto&quot; frameborder=&quot;1&quot;>
    <frame name=&quot;frame3&quot; src=&quot;#sFrame3page#&quot; marginwidth=&quot;10&quot; marginheight=&quot;10&quot; framespacing=&quot;0&quot; scrolling=&quot;auto&quot; frameborder=&quot;1&quot;>
    </CFOUTPUT>
</frameset>

the trick would be where/when and how to set the session variables. You'd have to have code on each frame page that set the appropriate variable to GetTemplatePath() or something.
Perhaps you could do it in an Application.cfm and save yourself a lot of trouble.



-Carl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top