[Chameleon] Widget help

D'cruz,Steven [Ontario] Steven.D'Cruz at ec.gc.ca
Wed Jul 28 11:28:16 EDT 2004


Hi there,

	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:
        <tr>
                <td>
		<span ID='PullDown'>
		        <select name='ExtractWFS'>
		                <script language="JavaScript">
		                <!--
		                        for
(i=0;i<goCWCJSAPI.oMap.numlayers;i++)
		                        {
		                                document.write("<option
value='"+i+"'>"+goCWCJSAPI.oMap.aLayers[i].name+"</option>");
		                        }
		                -->
		                </script>
		        </select>
		</span>
                </td>
        </tr>

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.

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:

<script language="JavaScript">
	all widget information, etc
	*ALLOWED* to access goCWCJSAPI
</script>
TemplateFileDump
<script language="JavaScript">
	my script
	*NOT ALLOWED* to access goCWCJSAPI
</script>

Essentially, my script is within a different <script> tag than the one
containing all the widget scripts...

Any suggestions would be greatly appreciated.

Steven D'Cruz
(GIS) Web Developer
Environment Canada
Steven.D'Cruz at ec.gc.ca

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/chameleon/attachments/20040728/73faed86/attachment.htm


More information about the Chameleon mailing list