<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.0.6487.1">
<TITLE>Widget help</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Arial">Hi there,</FONT>
</P>
<P> <FONT SIZE=2 FACE="Arial">I'm currently using chameleon 1.0.5, and am attempting to modify the default template file (test.html) such that it has build in wfs extraction functionality (as opposed to creating a widget for the same purpose). The code I'm attempting to add is this:</FONT></P>
<P><FONT SIZE=2 FACE="Arial"> <tr></FONT>
<BR><FONT SIZE=2 FACE="Arial"> <td></FONT>
<BR> <FONT SIZE=2 FACE="Arial"><span ID='PullDown'></FONT>
<BR> <FONT SIZE=2 FACE="Arial"> <select name='ExtractWFS'></FONT>
<BR> <FONT SIZE=2 FACE="Arial"> <script language="JavaScript"></FONT>
<BR> <FONT SIZE=2 FACE="Arial"> <!--</FONT>
<BR> <FONT SIZE=2 FACE="Arial"> for (i=0;i<goCWCJSAPI.oMap.numlayers;i++)</FONT>
<BR> <FONT SIZE=2 FACE="Arial"> {</FONT>
<BR> <FONT SIZE=2 FACE="Arial"> document.write("<option value='"+i+"'>"+goCWCJSAPI.oMap.aLayers[i].name+"</option>");</FONT></P>
<P> <FONT SIZE=2 FACE="Arial"> }</FONT>
<BR> <FONT SIZE=2 FACE="Arial"> --></FONT>
<BR> <FONT SIZE=2 FACE="Arial"> </script></FONT>
<BR> <FONT SIZE=2 FACE="Arial"> </select></FONT>
<BR> <FONT SIZE=2 FACE="Arial"></span></FONT>
<BR><FONT SIZE=2 FACE="Arial"> </td></FONT>
<BR><FONT SIZE=2 FACE="Arial"> </tr></FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Because the layers are dynamically generated, the layername must be specified directly in the template file (even if I were to implement the rest in a widget). The goal is for the option value (i) to be used as a method of referencing the particular layer.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">The problem I'm encountering is the inability to access the goCWCJSAPI variable and it's contents. I've tried numerous ways (document.goCWCJSAPI, window.goCWCJSAPI)… does anyone know the proper method of accessing the goCWCJSAPI variable from within the template file? Also of note is that in the final output (Chameleon Demo), the source for the demo looks similar to the following:</FONT></P>
<P><FONT SIZE=2 FACE="Arial"><script language="JavaScript"></FONT>
<BR> <FONT SIZE=2 FACE="Arial">all widget information, etc</FONT>
<BR> <FONT SIZE=2 FACE="Arial">*ALLOWED* to access goCWCJSAPI</FONT>
<BR><FONT SIZE=2 FACE="Arial"></script></FONT>
<BR><FONT SIZE=2 FACE="Arial">TemplateFileDump</FONT>
<BR><FONT SIZE=2 FACE="Arial"><script language="JavaScript"></FONT>
<BR> <FONT SIZE=2 FACE="Arial">my script</FONT>
<BR> <FONT SIZE=2 FACE="Arial">*NOT ALLOWED* to access goCWCJSAPI</FONT>
<BR><FONT SIZE=2 FACE="Arial"></script></FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Essentially, my script is within a different <script> tag than the one containing all the widget scripts...</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Any suggestions would be greatly appreciated.</FONT>
</P>
<P ALIGN=CENTER><B><I><FONT SIZE=2 FACE="MS LineDraw">Steven D'Cruz</FONT></I></B></P>
<P ALIGN=CENTER><B><I><FONT SIZE=2 FACE="MS LineDraw">(GIS) Web Developer</FONT></I></B></P>
<P ALIGN=CENTER><B><I><FONT SIZE=2 FACE="MS LineDraw">Environment Canada</FONT></I></B></P>
<P ALIGN=CENTER><B><I><FONT SIZE=2 FACE="MS LineDraw">Steven.D'Cruz@ec.gc.ca</FONT></I></B><I></I></P>
</BODY>
</HTML>