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!

Newbie: how to update two frames with a value from the third frame

Status
Not open for further replies.

cadoltt

Programmer
Joined
Jun 9, 2005
Messages
85
Location
CA
Hi everybody,

My problem seems pretty basic, hopefully someone will find a few minutes to look at it. My simplified application screen is built of three frames. In one of them (controlFrame.cfm) there is a form having a textbox input control - TXBPTNO - (where a user can enter some number) and a submit button. In the other two frames (dataFrame.cfm and graphFrame.cfm) the entered number should appear when the button is pressed.

The frameset is determined in the index.cfm template. I've also created the application.cfm template where I declare a var 'application.pt_no' via which I want to communicate with dataFrame.cfm and graphFrame.cfm from controlFrame.cfm. That means the entered number should go into this var and then this new value is to appear in the 'data' and 'graph' frames.

So far I didn't succeed in this, for example my attempt to set the new value with <cfset Application.pt_no=#txbPtNo#> (in the controlFrame.cfm) gives me an error message: 'Variable TXBPTNO is undefined'.

Here I put code of all the templates.


application.cfm code:
Code:
<cfapplication name="prj_test2"
 ClientManagement="No"
 SessionManagement="Yes"
 SessionTimeout="#CreateTimeSpan(0,0,10,0)#"
 ApplicationTimeout = #CreateTimeSpan(0,0,10,0)#
 SetClientCookies="Yes">


    <CFLOCK SCOPE="Application" TIMEOUT="30" TYPE="Exclusive">

       <CFIF NOT IsDefined("Application.pt_no")>
        <CFSET application.pt_no = 0>
       </CFIF>

    </CFLOCK>



index.cfm code
Code:
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]

<head>
</head>


 <frameset cols="50%,*">
   <frame src="dataFrame.cfm" name="dataFrame" id="dataFrame" title="dataFrame" />

   <frameset rows="50%,*">
     <frame src="graphFrame.cfm" name="graphFrame" id="graphFrame" title="graphFrame" />
     <frame src="controlFrame.cfm" name="controlFrame" id="controlFrame" title="controlFrame" />

   </frameset>

  </frameset>
  

 <noframes>
  <body>
  </body>
 </noframes>

</html>




controlFrame.cfm code
Code:
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
</head>


<body>
 <cfform action="index.cfm" method="post" target="_top">

     <p>Number: <cfinput name="txbPtNo" type="text" value="#Application.pt_no#" />


     <!---cfset Application.pt_no=#txbPtNo#--->


     <cfinput name="btn_GetData" type="submit" value="GetData"  />


 </cfform>


</body>

</html>





dataFrame.cfm code
Code:
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
 <head>
 </head>
 
 <body>
 
  <cfoutput>
    In dataFrame pt_no=#application.pt_no#
  </cfoutput>     
  
 </body>
 
</html>




graphFrame.cfm code
Code:
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
 <head>
 </head>
 
 <body>
 
  <cfoutput>
    In graphFrame pt_no=#application.pt_no#
  </cfoutput>     
  
 </body>
 
</html>




Can anyone help me with the mess?


Thanks,
Alex
 
My suggestion:

Don't use frames. Use cfinclude files. Maybe use iframes if you are dead set on using some kind of frame.

Regular frames are a pain in the ____ which is why most programmers avoid them like the plague.

[URL unfurl="true"]http://www.google.com/intl/en/webmasters/2.html[/url]
[URL unfurl="true"]http://www.agnr.umd.edu/intranet/webtips/frames.html[/url]
[URL unfurl="true"]http://www.thewebforbusiness.com/articles/develop/dmay2000.shtml[/url]
[URL unfurl="true"]http://www.noframes.org/[/url]

Kris Brixon

If you're not failing every now and again, it's a sign you're not doing anything very innovative.
- W. Allen
 
I agree. rethink the frames. I can hardly stand to use a site that uses (obviously uses, some hide it well) frames...

 
Kris, Imstillatwork,

Thanks for the tip. As I'm just starting, it is not a problem to me to reconsider the entire design strategy - I will study this. Though I'd like to find out how different templates can communicate via global variables, in my case ones with application scope.

Any clues?

Thanks,
Alex
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top