<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.3790.2491" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>and also replace var result = "{if
$tables_result}1{else}0{/if}"; <BR> </FONT></DIV>
<DIV><FONT size=2><BR> 2006/7/19,
Oliver Christen <<A
href="mailto:oliver.christen@camptocamp.com">oliver.christen@camptocamp.com</A>
>: <BR> ok, it was some
javascript problems:<BR> -
its not innerhtml, its
innerHTML<BR> - popuppage
refer to a variable name, not the new popup
name<BR> and possibly
window.onload is not already declared</DIV>
<DIV> </DIV>
<DIV> replace your code
with this:</DIV>
<DIV> </DIV>
<DIV> myContent =
document.getElementById("result").innerHTML;<BR>
popuppage = window.open('',
'popuppage','toolbar=no,location=no,status=no,menubar=no,resizable=yes,scrollbars=yes,copyhistory=no,width=300,height=400');<BR>
<BR> Also you may have to
change "window.onload += function() {" by "window.onload = function() {" if
nothing happens</DIV>
<DIV> </DIV>
<DIV>
Oliver<BR>
When I do a query it fills the div and the var result = 1. I don't have
javascripts error. But there's no popup....</DIV>
<DIV> </DIV>
<DIV><BR>
2006/7/19, Oliver Christen < <A
href="mailto:oliver.christen@camptocamp.com">oliver.christen@camptocamp.com</A>>:
<BR>
This goes in the cartoclient.tpl so you did it right.</DIV>
<DIV> </DIV>
<DIV>
now, when you do a query, it should fill the <div> with a table of
results. It will not be displayed on your screen but you can see it if you look
at the source of the page (View->Page Source in your browser)</DIV>
<DIV> </DIV>
<DIV>
So, do you see the table result in the source? You can try to temporarily remove
the style="display:none;" so you can the result on your page</DIV>
<DIV> </DIV>
<DIV>
If you have a table of result, it should now activate the javascript when the
page load. If you look at the page source, you should find "var result =
1;"<BR>
If you see "var result = 0" then there was no result to your query and the
<div> should be empty too.</DIV>
<DIV> </DIV>
<DIV>
If "var result = 1;", do you have any javascript errors reported in your
browser? If yes, what is the error message.</DIV>
<DIV> </DIV>
<DIV>
Oliver</DIV>
<DIV> </DIV>
<DIV><BR>
I put that part into the head of the cartoclient template:</DIV>
<DIV> </DIV>
<DIV>
<script language="JavaScript"
type="text/javascript"><BR>
<!--<BR>
var result = "{if $tables_result|default:'0'}'1'{/if}";
<BR>
{literal}<BR>
window.onload += function()
{<BR>
if (result == "1")
{<BR>
myContent =
document.getElementById("result").innerhtml;<BR>
window.open('',
'popuppage',<BR>
'toolbar=no,location=no,status=no,menubar=no,resizable=yes,scrollbars=yes,co
<BR>
pyhistory=no,width=300,height=400');<BR>
popuppage.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD
HTML<BR>
4.01//EN""<A
href="http://www.w3.org/TR/html4/strict.dtd">http://www.w3.org/TR/html4/strict.dtd</A>
">'+<BR>
'<html><head><title>My
window</title></head><body>' +
myContent<BR>
+ '</body></html>')
}<BR>
}<BR>
{/literal}<BR>
//--><BR>
</script></DIV>
<DIV> </DIV>
<DIV>
and i put these part in the body of the file</DIV>
<DIV> </DIV>
<DIV>
<div id="result"
style="display:none;"><BR>
{$tables_result}<BR>
</div></DIV>
<DIV> </DIV>
<DIV>
In fact I don't really know where I should put theses files except the first
that has to be in the head of an html file. </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV></FONT> </DIV></BODY></HTML>