<!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>ok, it was some javascript problems:</FONT></DIV>
<DIV><FONT size=2>- its not innerhtml, its innerHTML</FONT></DIV>
<DIV><FONT size=2>- popuppage refer to a variable name, not the new popup
name</FONT></DIV>
<DIV><FONT size=2>and possibly </FONT><FONT size=3>window.onload is not already
declared</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>replace your code with this:</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> 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>
</FONT></DIV>
<DIV><FONT size=2>Also you may have to change </FONT><FONT size=3>"window.onload
+= function() {" by </FONT><FONT size=2>"window.onload = function() {" if
nothing happens</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Oliver</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">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....<BR><BR>
<DIV><SPAN class=gmail_quote>2006/7/19, Oliver Christen <<A
href="mailto:oliver.christen@camptocamp.com">
oliver.christen@camptocamp.com</A>>:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV>
<DIV bgcolor="#ffffff">
<DIV><FONT size=2>This goes in the cartoclient.tpl so you did it
right.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>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)</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>So, do you see the table result in the source? You can try
to temporarily remove the </FONT><FONT size=3>style="display:none;" so you
can the result on your page</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>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 </FONT><FONT size=3>"var result = 1;"</FONT></DIV>
<DIV>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><FONT size=2>If </FONT><FONT size=3>"var result = 1;", do you have any
javascript errors reported in your browser? If yes, what is the error
message.</FONT></DIV></DIV>
<DIV><SPAN class=sg>
<DIV> </DIV>
<DIV><FONT size=2>Oliver</FONT></DIV></SPAN></DIV>
<DIV><SPAN class=q>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV><FONT size=2></FONT><BR></DIV>I put that part into the head of the
cartoclient template:<BR><BR> <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
onclick="return top.js.OpenExtLink(window,event,this)"
href="http://www.w3.org/TR/html4/strict.dtd"
target=_blank>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><BR><BR>and i put these part in the body of the
file<BR><BR><div id="result"
style="display:none;"><BR>
{$tables_result}<BR> </div><BR><BR>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. <BR><BR></BLOCKQUOTE></SPAN></DIV>
<DIV></DIV></DIV></BLOCKQUOTE></DIV><BR></BLOCKQUOTE></BODY></HTML>