Click to See Complete Forum and Search --> : Refresh or Reload in frames
asolell
05-12-2003, 02:30 PM
Hi,
I have a treeview on on frame and when I click on the leaf it loads a page in the second frame. Now that page, is a PHP page that is loaded dynamically.
So far no problem.
But, now,. when I make updates (the PHP engine has
few pages for inserts, deletes and updates in the
main frame).
When I click on the list all leaf, it shows the old values
of the main frame.
How do I force it to refresh everytime that I click on the leaf in the TreeView?
Thanks,
-Alon.
js@wsco.com
Please post your code, or better yet, a link to the page with this problem. Otherwise, we have only vague assumptions to help you out.
khalidali63
05-12-2003, 02:56 PM
you can use this code
<meta http-equiv="Pragma" content="no-cache;">
asolell
05-12-2003, 03:21 PM
khalidali63 you are on the money!
That is exactly what I needed!
That's actually a great line and I just wish I'd knew about it before.
Thanks a lot,
-Alon.
khalidali63
05-12-2003, 03:42 PM
:D
You are welcome...
asolell
05-17-2003, 03:24 PM
Hi All,
I have the same problem again.. just a slightly different angle.
The solution that was proposed and implemented works fine for the a page that handles itself, or more like if the page in that frame is updated, it works fine and doesn't cache the previous values.
However, if that page is being called from a different frame,
the cached version is being called even with the solution
<meta http-equiv="Pragma" content="no-cache;">
So now, I need to have a code that does a fresh reload of a page from one frame to next frame.
While it is in the same frame, the page doesn't get cached and works fine. But if a different frame is making the call, the old page is poping up.
So I need:
<a href="http://www.mysite.com/mylink.php">This is in SideFrame -Click Here to load and refresh the page in
anotherFrame</a>
I just need a javascript that does the refresh, not just
a simple link.
-Alon.
khalidali63
05-17-2003, 03:49 PM
you could use this to reload a specific frame
parent.frameName.window.location.reload();
asolell
05-17-2003, 04:53 PM
Well,...
I'm using the TreeView that is available via http://www.treeview.net/ and I sent a request to the authers to provide a function or enhance a function with a flag for optional reloads of pages.
I checked the source code, and it is doing lots of good things until it actually allows me to get the link in the frames.
I've sent him the line:
parent.frameName.window.location.reload();
and asked him/her to enhance thier product with that option.
Hopefully they will come up with something built in, otherwise it is going to be a bit of a havoc going through their code and trying to tweak it (not to mention a violation of their rules of no mods to their code).
Again, I apreciate you assistance with that.
-Alon.
khalidali63
05-17-2003, 04:57 PM
No problem..:p
asolell
05-17-2003, 11:25 PM
Hi all,
Here is the function that makes the call from the Treeview frame and populates the other frame.
insDocX(aux200011, gLnk("R", "List Inventory", "../InventorySetup/ListInventoryItem.php"))
Marcelino the author of TreeView told me to simply use the function as the url.
But, how do I go about doing that?
See the code above? well, how do I 'stick' the reload option
in there?
parent.frameName.window.location.reload();
I have 3 frames:
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<frameset rows="93,*">
<frame name="banner" scrolling="no" noresize target="contents" src="TopFrame/Top1.html">
<frameset cols="702,*">
<frame name="basefrm" target="main" scrolling="auto" src="TreeFrame/welcome.html">
<frame name="treeframe" scrolling="auto" src="TreeFrame/demoLargeLeftFrame.html">
</frameset>
<noframes>
<body>
<p>This page uses frames, but your browser doesn't support them.</p>
</body>
</noframes>
</frameset>
</html>
I appreciate your help on this.
-Alon
khalidali63
05-17-2003, 11:30 PM
that will be not easy..unless I see the API to explain the method and what are the paramters passed to the methods..sowwy..unless you can provide me with that info
asolell
05-18-2003, 03:14 AM
I've included 3 functions that are handling the process of the link.
I believe it should be another flag in thd signature that should be marked with a Yes/No for a reload() option, or perhaps it would be easier to simply have a new function as awhole?
Thank you very much,
-Alon.
function Item(itemDescription, itemLink, target) // Constructor
{
// constant data
this.desc = itemDescription
this.link = itemLink
this.id = -1 //initialized in initalize()
this.navObj = 0 //initialized in render()
this.iconImg = 0 //initialized in render()
this.iconSrc = ICONPATH + "ftv2doc.gif"
this.isRendered = 0
this.isLastNode = false
this.level = 0
this.leftSideCoded = ""
this.nChildren = 0
this.target = target
this.parentObj = null
this.maySelect=true
this.prependHTML = ""
// methods
this.initialize = initializeItem
this.createIndex = createEntryIndex
this.escondeBlock = escondeBlock
this.esconde = escondeBlock
this.folderMstr = folderMstr
this.renderOb = drawItem
this.totalHeight = totalHeight
this.blockStartHTML = blockStartHTML
this.blockEndHTML = blockEndHTML
this.getID = getID
this.forceOpeningOfAncestorFolders = forceOpeningOfAncestorFolders
}
////////////////////////////////////////////////////////////////
function gLnk(optionFlags, description, linkData)
{
var fullLink = "";
var targetFlag = "";
var target = "";
var protocolFlag = "";
var protocol = "";
if (optionFlags>=0) //is numeric (old style) or empty (error)
{
return oldGLnk(optionFlags, description, linkData)
}
targetFlag = optionFlags.charAt(0)
if (targetFlag=="B")
target = "_blank"
if (targetFlag=="P")
target = "_parent"
if (targetFlag=="R")
target = "basefrm"
if (targetFlag=="S")
target = "_self"
if (targetFlag=="T")
target = "_top"
if (optionFlags.length > 1) {
protocolFlag = optionFlags.charAt(1)
if (protocolFlag=="h")
protocol = "http://"
if (protocolFlag=="s")
protocol = "https://"
if (protocolFlag=="f")
protocol = "ftp://"
if (protocolFlag=="m")
protocol = "mailto:"
}
fullLink = "'" + protocol + linkData + "' target=" + target
linkItem = new Item(description, protocol+linkData, target)
return linkItem
}
////////////////////////////////////////////////////////////////
//Function created Aug 1, 2002 for backwards compatibility purposes
function oldGLnk(target, description, linkData)
{
var fullLink = "";
//Backwards compatibility code
if (USEFRAMES)
{
if (target==0)
{
fullLink = "'"+linkData+"' target=\"basefrm\""
}
else
{
if (target==1)
fullLink = "'http://"+linkData+"' target=_blank"
else
if (target==2)
fullLink = "'http://"+linkData+"' target=\"basefrm\""
else
fullLink = linkData+" target=\"_top\""
}
}
else
{
if (target==0)
{
fullLink = "'"+linkData+"' target=_top"
}
else
{
if (target==1)
fullLink = "'http://"+linkData+"' target=_blank"
else
fullLink = "'http://"+linkData+"' target=_top"
}
}
linkItem = new Item(description, fullLink)
return linkItem
}