[Cartoweb-users] query table

Oliver Christen oliver.christen at camptocamp.com
Wed Jul 19 02:25:59 EDT 2006


This goes in the cartoclient.tpl so you did it right.

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)

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

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;"
If you see "var result = 0" then there was no result to your query and the <div> should be empty too.

If "var result = 1;", do you have any javascript errors reported in your browser? If yes, what is the error message.

Oliver


  I put that part into the head of the cartoclient template:

   <script language="JavaScript" type="text/javascript">
      <!--
    var result = "{if $tables_result|default:'0'}'1'{/if}"; 
    {literal}
      window.onload += function() {
        if (result == "1") {
          myContent =  document.getElementById("result").innerhtml;
          window.open('', 'popuppage',
  'toolbar=no,location=no,status=no,menubar=no,resizable=yes,scrollbars=yes,co 
  pyhistory=no,width=300,height=400');
           popuppage.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
  4.01//EN""http://www.w3.org/TR/html4/strict.dtd ">'+
              '<html><head><title>My window</title></head><body>' + myContent
  + '</body></html>')       }
      }
      {/literal}
      //-->
    </script>

  and i put these part in the body of the file

  <div id="result" style="display:none;">
                {$tables_result}
   </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. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/cartoweb-users/attachments/20060719/c5217ae2/attachment.html


More information about the Cartoweb-users mailing list