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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Frame will not Refresh 1

Status
Not open for further replies.

LyndonOHRC

Programmer
Sep 8, 2005
603
US
I'm trying to get a frame to reload from the original page. The left frame reloads fine but the right bottom will not???
Where I commented out I even tried setting the location.href to the original file name and nothing happens either way; no error or refresh.

Code:
<script language="JavaScript">
<!---  
 //var ReloadFile='right_bottom_frame.cfm';
 parent.leftFrame.location.reload(); 
 //parent.rightBottomFrame.location.href = ReloadFile; 
 parent.rightBottomFrame.location.reload(); 
--->
</script>

During the use of the page the bottom right frame gets loaded with a PDF document with the following code:

Code:
<script language="JavaScript">
<!-- 
function show_pdf_page(doc2show,DisplayName) {
parent.rightBottomFrame.location.href = doc2show+'#page=1';
    }
-->
</script>

<a ref="javascript:show_pdf_page'#Session.TargetFile#','#Session.DisplayFile#')">
#FileList.name#<a>

Maybe the PDF is the trouble? I'm stumped.

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
everything is on the same file server.

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
Thanks Dan,

Unfortunately both of those typos were from my poor job of cut and paste into the message board. It was correct in the actual source.

Maybe more detail on the application will yield a clue.

I have frame page with three cells, leftFrame, rightTopFrame, and rightBottomFrame. The source and the PDF documents are all on our only server. The application offers a directory of PDF’s that have been scanned so they may be indexed for future retrieval.

When the client selects a link to a PDF in leftFrame, it is displayed in rightBottomFrame for their inspection. In this same process rightTopFrame is populated with a form to get the index data from the client.

When the form is submitted I’m trying to trigger the following actions: 1. Use the form data to rename the PDF (this is working). 2. Reload the document in leftFrame so the file list only includes non indexed PDF’s (this is working). 3. Disable the form in rightTopFrame so client cannot provide index data until another PDF is selected (this is working). 4. Reload the document in rightBottomFrame so client no longer sees the recently indexed and renamed PDF (this is not working).

RaceDay.cfm (parent window)
Code:
<cfparam name="Session.TargetFile" default="">
<cfparam name="Session.DisplayFile" default="">
<cfparam name="Session.ListScope" default="New">
<frameset cols="15%,*" rows="100%" frameborder="0" style="border : solid 1px DodgerBuleBlack;" s>
 <frame scrolling="" name="leftFrame" src="left_frame.cfm" frameborder="0" scrolling="No">
 <frameset rows="25%,*" frameborder="0" style="border : solid 1px DodgerBuleBlack;">
  <frame name="rightTopFrame" src="right_top_frame.cfm" frameborder="0" scrolling="No">
  <frame name="rightBottomFrame" src="right_bottom_frame.cfm" frameborder="0">
 </frameset>
</frameset>

left_frame.cfm contents
Code:
<script language="JavaScript">
<!-- hide js
function show_pdf_page(doc2show,DisplayName) {
parent.rightBottomFrame.location.href = doc2show+'#page=1';
parent.rightTopFrame.SelectedDocumentName.innerHTML=DisplayName;
parent.rightTopFrame.IndexForm.DisplayFile.value=DisplayName;
parent.rightTopFrame.IndexForm.RenameFile.disabled=false;
    }
-->
</script>
<cfinclude template="../includes\binkley.css">
<html>
<body>
<cfif Isdefined("url.ListScope")>
	<cfset Session.ListScope = url.ListScope>
</cfif>
<table border="0">
	<tr>
		<td class="NormalCell" nowrap>
			<a class="special" href="[URL unfurl="true"]http://www.ohrc.org/binkley"[/URL] target="_self" style="font-size: 70%;">Return to Binkley</a>
		</td>
	</tr>
	</tr>
	<tr>
		<td class="NormalCell" nowrap>
			<cfoutput>
				<a href="?ListScope=New" class="Special" style="font-size: 70%;" title="Only see documents that have not been indexed">New</a> 
				<a href="?ListScope=Indexed" class="Special" style="font-size: 70%;" title="Only see documents that have been indexed">Indexed</a> 
				<a href="?ListScope=All" class="Special" style="font-size: 70%;" title="See all documents">All</a>
			</cfoutput>
		</td>
	</tr>
	<tr>
		<td class="NormalCell" nowrap>
			<cfoutput><span class="NormalCell" style="font-size: 70%;">#Session.ListScope# Documents</span></cfoutput>
		</td>
	</tr>
	<cfquery name="DocumentList" datasource="ScannedDocuments">
		Select FileName
		From RaceDay
	</cfquery>
	<cfset vlFileNames=ValueList(DocumentList.FileName)>
	<cfdirectory name="FileList" action="LIST" filter="*.pdf" directory="f:\race day" sort="datelastmodified">
	<cfoutput query="FileList">
		<cfset Show='Yes'>
		<cfif Session.ListScope eq 'Indexed'>
			<cfif ListFindNoCase(vlFileNames,FileList.Name) eq 0>
				<cfset Show='No'>
			</cfif>
		</cfif>
		<cfif Session.ListScope eq 'New'>
			<cfif ListFindNoCase(vlFileNames,FileList.Name) gt 0>
				<cfset Show='No'>
			</cfif>
		</cfif>
		<cfif Show eq 'Yes'>
			<tr>
				<td class="NormalCell" nowrap>
					<cfset Session.DisplayFile=FileList.name>
					<cfset Session.TargetFile="[URL unfurl="true"]http://www.ohrc.org/ExternalScanDrive/race[/URL] day/"&FileList.name>
					<a 	class="special" 
						href="javascript:show_pdf_page('#Session.TargetFile#','#Session.DisplayFile#')" 
						style="font-size: 70%;" 
						title="Dtae: #DateFormat(FileList.dateLastModified,'mm/dd/yyyy')# Size: #NumberFormat((FileList.size/1024))#MB">
						#FileList.name# 
					</a>
				</td>
			</tr>
		</cfif>
	</cfoutput>
</table>
</body>
</html>

right_Top_Frame.cfm contents
Code:
<cfinclude template="..\includes\binkley.css">
<html>
<body onload="parent.leftFrame.location.reload();" style="Background-Color: white;">
<table class="BinkleyTable" <!--- width="100%" ---> style="Background-Color: white;" align="left" cellspacing="4">
	<cfform name="IndexForm" action="RaceDayActionForm.cfm" method="post">
		<input type="Hidden" value="" name="DisplayFile">
	<tr>
		<td colspan="4" id="SelectedDocumentName" class="ColumnHeadingCell">
			Select Document From List
		</td>
	</tr>
		<tr align="left">
			<td class="NormalCell" nowrap>
				<div align="right">Race Date:</div> 
			</td>
			<td class="NormalCell" nowrap>
				<cfinput name="DocumentDate" size="10" required="Yes" validate="date" message="Valid Date Required">
			</td>
			<td class="NormalCell" nowrap>
				<div align="right">Track: </div>
			</td>
			<td class="NormalCell" nowrap>
				<select name="DocumentTrack">
					<option value="B">BRD</option>
					<option value="R">RP</option>
					<option value="W">WRD</option>
					<option value="F">FMT</option>
				</select>
			</td>
		</tr>
		<tr>
			<td class="NormalCell" colspan="4">
				<div align="center"><input type="Submit" name="RenameFile" value="Save" disabled></div>
			</td>
		</tr>
	</cfform>
</table>
</body>
</html>

right_bottom_frame.cfm
Code:
<cfinclude template="..\includes\binkley.css">
<html>
<body onload="parent.leftFrame.location.reload();" style="Background-Color: white;">
<table class="BinkleyTable" <!--- width="100%" ---> style="Background-Color: white;" align="left" cellspacing="4">
	<cfform name="IndexForm" action="RaceDayActionForm.cfm" method="post">
		<input type="Hidden" value="" name="DisplayFile">
	<tr>
		<td colspan="4" id="SelectedDocumentName" class="ColumnHeadingCell">
			Select Document From List
		</td>
	</tr>
		<tr align="left">
			<td class="NormalCell" nowrap>
				<div align="right">Race Date:</div> 
			</td>
			<td class="NormalCell" nowrap>
				<cfinput name="DocumentDate" size="10" required="Yes" validate="date" message="Valid Date Required">
			</td>
			<td class="NormalCell" nowrap>
				<div align="right">Track: </div>
			</td>
			<td class="NormalCell" nowrap>
				<select name="DocumentTrack">
					<option value="B">BRD</option>
					<option value="R">RP</option>
					<option value="W">WRD</option>
					<option value="F">FMT</option>
				</select>
			</td>
		</tr>
		<tr>
			<td class="NormalCell" colspan="4">
				<div align="center"><input type="Submit" name="RenameFile" value="Save" disabled></div>
			</td>
		</tr>
	</cfform>
</table>
</body>
</html>

RaceDayActionForm.cfm (Action Page for Form)
Code:
<cfoutput>
	<cfset NewFileName=form.DocumentTrack&DateFormat(form.DocumentDate,'yyyymmdd')&'RaceDayFile'>
	<cfquery name="CheckFileName" datasource="ScannedDocuments">
		Select FileName
		From RaceDay
		Where FileName like '#Left(NewFileName,8)#%'
	</cfquery>
	<cfset Increment=CheckFileName.RecordCount+1>
	<cfset NewFileName=NewFileName&NumberFormat(Increment,'000')&'.PDF'>
	<cfset PutTrack='BRD'>
	<cfif Left(NewFileName,1) eq 'R'>
		<cfset PutTrack='RP'>
	</cfif>
	<cfif Left(NewFileName,1) eq 'W'>
		<cfset PutTrack='WRD'>
	</cfif>
	<cfif Left(NewFileName,1) eq 'F'>
		<cfset PutTrack='FMT'>
	</cfif>
	Disp file: #form.DisplayFile#
	<cffile 
		action="RENAME" 
		source="f:\race day\#form.DisplayFile#" 
		destination="f:\race day\#NewFileName#">
	<cfquery name="PutFileName" datasource="ScannedDocuments">
		Insert Into RaceDay(FileName,Track)
		Values ('#NewFileName#','#PutTrack#')
	</cfquery>
	New Name: #NewFileName#<br>
	Old File Name: #form.DisplayFile#
</cfoutput>
<script language="JavaScript">
	<!---  
		//var ReloadFile='right_bottom_frame.cfm';
		parent.leftFrame.location.reload(); 
		//parent.rightBottomFrame.location.href = ReloadFile; 
		parent.rightBottomFrame.location.reload(); 
		
	 --->
</script>

<cflocation url="right_top_frame.cfm">

Thanks

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
Oooops, In the message above I show the wrong content for right_bottom_frame.cfm. It should be:

Code:
<html>

</html>

Sorry

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
I even tried creating a pdf with no content and putting it into rightBottomFrame. Still no luck. It's like the location.href value is locked and cannot be reset unless an actual link has been selected as in leftFrame (if I select a link in leftFrame it will overwrite rightBottomFrame).

I've changed, as seen below, the script at the bottom of RaceDayActionForm.cfm and the second parameter of show_pdf_page does execute, still no luck getting the first parameter to work.

I'm stumped. I guess the location.href can only be reset if the client has actually selected a link tag. But, I have no idea how I might change the content of rightBottomFrame from the submit action page (RaceDayActionForm.cfm)???

Any ideas welcome.

Code:
<script language="JavaScript">
	javascript:show_pdf_page('blank.pdf','Select another document');
	parent.leftFrame.location.reload(); 
</script>

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
I don't see why it should make a difference, but give this a whirl anyway... try removing the "#" parameter from the URL building in the show_pdf_page function:

Code:
parent.rightBottomFrame.location.href = doc2show[!][s]+'#page=1'[/s][/!];

I'm also confused... how does the script in RaceDayActionForm.cfm call the show_pdf_page function when it is a different frame, but doesn't reference it? Do you have a different (maybe older, forgotten about) version of show_pdf_page anywhere else in RaceDayActionForm.cfm (try viewing the client-side code?).

Dan

Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
do you have a URL with this site up at?
This is completly test data so you can use the form as much as you want.
how does the script in RaceDayActionForm.cfm call the show_pdf_page function when it is a different frame, but doesn't reference it?
I don't know much, yet, about js scope but it must be running the function because the second parameter that writes 'Select another document' into the form on rightTopFrame is working.... I guess its because the function has already run once and the client knows where the code for that function is???
try removing the "#"
I did that and no behavior change. I just left that as I was thinking of putting client defined start page in the form too. Never got that far.




Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
Blimey - it's been so long since I've seen a site with frames, that's taken me back a bit. It looks like your frameset definition is completely wrong.

A few minor issues (no HTML tags, erroneous characers in your markup, etc), and a few major ones (you should only specify [!]either[/!] "cols" [!]or[/!] "rows", but never both). The latter might also explain the odd scripting behaviour. Try this for a frameset definition:

Code:
<html>
	<frameset cols="15%,*" frameborder="0" style="border: solid 1px #000000;">
		<frame scrolling="" name="leftFrame" src="left_frame.cfm" frameborder="0" scrolling="no">
		<frameset rows="25%,*" frameborder="0" style="border: solid 1px #000000;">
			<frame name="rightTopFrame" src="right_top_frame.cfm" frameborder="0" scrolling="no">
			<frame name="rightBottomFrame" src="right_bottom_frame.cfm" frameborder="0">
		</frameset>
	</frameset>
</html>

Note: You might need to reference the correct frame for your JS call after doing this.

You might have found these if you attempted to validate your page. Give it a go and see what the validator shows up.

Hope this helps,
Dan

Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
I guess I better learn to validate html. Is that a tool? Any suggestions.

I made the change you suggested; no difference.

This line of code, in left_frame.cfm works perfecrtly when triggered by the <a> tag but does not work when called from RaceDayActionForm.cfm when triggered by the form submit?

Code:
parent.rightBottomFrame.location.href = doc2show;

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
Error: element FRAMESET not defined in this HTML version

I know we don't want this thread to get outside the scope of the original question, however, the validators I've tried think frames are not valid. This is very perplexing to me; before I got this message the validatiors said all [/color red]the attributes used for frameset and frame were invalid attributes. This is the message I got after removing the attributes one at a time. I’m guess I don’t see how this relates the JavaScript question.

I know people don't like frames very much and I need to get much better at HTML. I probably need to change this to <div> but could not figure out how to get the left side menu and two right side panels to work so I did the frameset and got the presentation order all set up quickly. Lazy I know.

But I don't think this problem is a presentation problem. This is an application used only in a controlled environment by employees on client workstations that are all configured the same and the app works great except for this one issue. The app is designed to let people very quickly view scanned documents and enter indexing data and move on to the next scanned document.

Like I said in a previous message if
Code:
parent.rightBottomFrame.location.href = doc2show;
works when triggered by the <a> [/color red]tag in left_frame.cfm then why does the same not work in RaceDayActionForm.cfm when triggered by the form submit process?

The application can be viewed at


Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
Try putting a "frames" DOCTYPE at the very top of your frameset page. Use this for XHTML 1.0 compatible:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">[/URL]

or this for HTML 4.01 compatible:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/frameset.dtd">[/URL]

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Just to correct something I said earlier:

Me said:
you should only specify either "cols" or "rows", but never both

That was wrong - you can specify both, but in your case, you do not need to (you are not creating a grid layout).

Try this for your frameset definition:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/frameset.dtd">[/URL]
<html>
<head>
	<title>Race Day</title>
	<meta http-equiv="content-type" content="text/html; charset=utf-8">
	<meta http-equiv="content-language" content="en">
</head>

<frameset cols="15%,*" style="border: 1px solid #000000;">
	<frame name="leftFrame" src="left_frame.cfm" frameborder="0" scrolling="no">
	<frameset rows="25%,*" style="border: 1px solid #000000;">
		<frame name="rightTopFrame" src="right_top_frame.cfm" frameborder="0" scrolling="no">
		<frame name="rightBottomFrame" src="right_bottom_frame.cfm" frameborder="0" scrolling="no">
	</frameset>
</frameset>

</html>

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
That didn't fix it. I already had HTML 4.01 from reading the validation feedback.

Did you ever try the link to the application?

BTW - Thanks so much for all you do on here. I really appreciate it!


Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
I think that fixing up your validation errors is something you should do. As you can see from this:


you have a lot of uncorrected problems that could (potentially, however far-fetched it may sound) stop DOM parsing working correctly.

For example, you need to put an HTML tag at the top of the page, then have a HEAD element with your script in, then close the HEAD, open the BODY, etc. Right now, you just have arbitrary script - even outside the HTML tag.

Fixing these up is a good move... and might make debugging easier (and if nothing else, give better structure to your pages), although I'll still keep looking :)

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top