<!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.6000.16608" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>well, then it's absolutly normal your javascript is NOT
executed.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>because the table html is loaded via ajax and the javascript
INSIDE the html are considered as text and NOT interpreted.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>if you want to execute some javascript code imported via ajax
in an html fragment , you have to explicitly call (initialize)
it from the handleResponse function in Table.ajax.js</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>regards</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">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=valerionoti@yahoo.it href="mailto:valerionoti@yahoo.it">Valerio
Noti</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
title=oliver.christen@camptocamp.com
href="mailto:oliver.christen@camptocamp.com">Oliver Christen</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Cc:</B> <A
title=cartoweb-users@lists.maptools.org
href="mailto:cartoweb-users@lists.maptools.org">cartoweb-users@lists.maptools.org</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, March 14, 2008 9:56
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [Cartoweb-users] Troubles
with tables.tpl</DIV>
<DIV><BR></DIV>Oliver,<BR>yes it's in ajax mode and if I disable ajax,
javascript code works inside the tpl . If it's active it works only when I
reload the page.<BR>Any tips? or other ways to retrieve query information and
open a pop up window?<BR><BR>valerio<BR><BR>
<DIV><SPAN class=gmail_quote>2008/3/13, 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 bgcolor="#ffffff">
<DIV><FONT size=2>you use your project in ajax mode now ?</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px"><SPAN
class=q>
<DIV
style="FONT: 10pt arial; font-size-adjust: none; font-stretch: normal">-----
Original Message ----- </DIV>
<DIV
style="BACKGROUND: rgb(228,228,228) 0% 50%; FONT: 10pt arial; font-size-adjust: none; font-stretch: normal; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"><B>From:</B>
<A title=valerionoti@yahoo.it
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:valerionoti@yahoo.it" target=_blank>Valerio Noti</A>
</DIV></SPAN>
<DIV><SPAN class=e id=q_118a8e4a6ca10341_2>
<DIV
style="FONT: 10pt arial; font-size-adjust: none; font-stretch: normal"><B>To:</B>
<A title=oliver.christen@camptocamp.com
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:oliver.christen@camptocamp.com" target=_blank>Oliver
Christen</A> </DIV>
<DIV
style="FONT: 10pt arial; font-size-adjust: none; font-stretch: normal"><B>Cc:</B>
<A title=cartoweb-users@lists.maptools.org
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:cartoweb-users@lists.maptools.org"
target=_blank>cartoweb-users@lists.maptools.org</A> </DIV>
<DIV
style="FONT: 10pt arial; font-size-adjust: none; font-stretch: normal"><B>Sent:</B>
Thursday, March 13, 2008 4:42 PM</DIV>
<DIV
style="FONT: 10pt arial; font-size-adjust: none; font-stretch: normal"><B>Subject:</B>
Re: [Cartoweb-users] Troubles with tables.tpl</DIV>
<DIV><BR></DIV>I tested democw3 tables.tpl in cw3.2 and 3.4<BR>This code
works in 3.2 each time I click on the map with query tool. In 3.4 it works
only when I reload the page, when I use query tool alert doesn't
appear.<BR><BR><SPAN>[...]</SPAN><BR><SPAN>{if $table->numRows >
0}<BR><script
language=javascript><BR>
{literal}<BR></SPAN><SPAN></SPAN><SPAN>
<DIV> alert
('Test');<BR>
{/literal}<BR></script><BR>[...]<BR><BR>Thank you
again<BR><BR>Valerio<BR><BR><BR></DIV></SPAN><BR><BR><BR>
<DIV><SPAN class=gmail_quote>2008/3/13, Valerio Noti <<A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:valerionoti@yahoo.it"
target=_blank>valerionoti@yahoo.it</A>>:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">yes
it's what I did, I copied /coreplugins/tables/templates folder in
projects/MyProject/coreplugins/tables/templates folder, modified 3.4
template and inserted javascript code between
{foreach}{/foreach}<BR><BR>thank you<BR><BR>
<DIV><SPAN class=gmail_quote>2008/3/13, Oliver Christen <<A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:oliver.christen@camptocamp.com"
target=_blank>oliver.christen@camptocamp.com</A>>:</SPAN>
<DIV><SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV bgcolor="#ffffff">
<DIV><FONT size=2>chance are pretty high the table template was
modified between 3.2 and 3.4 so I would suggest to compare a table
templates in 3.4 and use it as a basis</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>regards</FONT></DIV>
<DIV><FONT size=2>Oliver</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV><SPAN>
<DIV
style="FONT: 10pt arial; font-size-adjust: none; font-stretch: normal">-----
Original Message ----- </DIV>
<DIV
style="BACKGROUND: rgb(228,228,228) 0% 50%; FONT: 10pt arial; font-size-adjust: none; font-stretch: normal; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"><B>From:</B>
<A title=valerionoti@yahoo.it
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:valerionoti@yahoo.it" target=_blank>Valerio Noti</A>
</DIV>
<DIV
style="FONT: 10pt arial; font-size-adjust: none; font-stretch: normal"><B>To:</B>
<A title=cartoweb-users@lists.maptools.org
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:cartoweb-users@lists.maptools.org"
target=_blank>cartoweb-users@lists.maptools.org</A> </DIV>
<DIV
style="FONT: 10pt arial; font-size-adjust: none; font-stretch: normal"><B>Sent:</B>
Thursday, March 13, 2008 3:53 PM</DIV>
<DIV
style="FONT: 10pt arial; font-size-adjust: none; font-stretch: normal"><B>Subject:</B>
[Cartoweb-users] Troubles with tables.tpl</DIV>
<DIV><BR></DIV>Hello,<BR>I usually modify tpl files inserting
javascript code. i.e. I modified tables.tpl in order to open a
pop-up windows when user click on the map with query
tool.<BR><BR>The following code works fine in cartoweb 3.2 but not
in cw3.4:<BR>[...]<BR>{foreach from=$tables item=group}<BR>foreach
from=$group->tables item=table}<BR>{if $table->numRows >
0}<BR><script
language=javascript><BR>
{literal}<BR>
strNomeTabella = '{/literal}{$table->tableTitle
<DIV>}{literal}';<BR>
alert ('Test');<BR>
{/literal}<BR></script><BR> {foreach
from=$table->columnTitles
item=column}<BR> <script
language=javascript><BR>
{literal}<BR>
var campo =
'{/literal}{$column}{literal}';<BR>
{/literal}<BR>
</script><BR>
{/foreach}<BR>[...]<BR>{/foreach}<BR>{/foreach}<BR><BR>In cw3.4 it
seems that javascript code is not active. Nothing is saved in
variables and alert statement doesn't work.<BR><BR><BR><BR>Thank you
very much for any
help<BR><SPAN><BR><BR>Valerio</SPAN></DIV></SPAN></DIV>
<P></P>
<HR>
<P></P>_______________________________________________<BR>Cartoweb-users
mailing list<BR><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:Cartoweb-users@lists.maptools.org"
target=_blank>Cartoweb-users@lists.maptools.org</A><BR><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="http://lists.maptools.org/mailman/listinfo/cartoweb-users"
target=_blank>http://lists.maptools.org/mailman/listinfo/cartoweb-users</A><BR>
<P></P></BLOCKQUOTE></DIV></BLOCKQUOTE></SPAN></DIV></DIV><SPAN><BR><BR
clear=all><BR>-- <BR>/* <BR>Valerio Noti<BR>*/
</SPAN></BLOCKQUOTE></DIV><BR><BR clear=all><BR>-- <BR>/* <BR>Valerio
Noti<BR>*/ </SPAN></DIV></BLOCKQUOTE></DIV></BLOCKQUOTE></DIV><BR><BR
clear=all><BR>-- <BR>/* <BR>Valerio Noti<BR>*/ </BLOCKQUOTE></BODY></HTML>