[Chameleon] Dynamic Template Changes
Paul Spencer
pagameba at magma.ca
Mon Aug 23 08:11:01 EDT 2004
Steven,
this should be relatively simple, it is the same mechanism that is used
by the ability to bilingualize the application ... your button needs to
call a javascript function that simply sets the form variable TEMPLATE
to the new value you want and then submits the page.
<script ...>
function switchTemplates()
{
document.forms[0].TEMPLATE.value = "http://path-to-new-template.html";
document.forms[0].submit();
}
</script>
If you need to go to different templates, I would modify this so that
the URL of the template is passed to this function :)
Cheers,
Paul
D'cruz,Steven [Ontario] wrote:
> Greetings,
>
> I'm currently using Chameleon v.1.0.5, and would like to enquire
> as to whether it is possible to create a button, which, if clicked,
> would send the user to a different template while preserving the current
> Javascript CWC object and it's associated variables (goCWCJSAPI). The
> reason for this requirement is that I've created two distinct templates;
> simple and advanced. The simple template has considerably less
> functionality than the advanced, although it is much more intuitave. I
> would like to create a button on the simple template that reloads the
> current map with a new template ( the advanced template ) while
> preserving the state of the map (layer status, zoom depth, etc). Is
> this possible in version 1.0.5 of Chameleon/CWC2? If not, I'd greatly
> appreciate suggestions for adding this functionality. If this
> functionality exists in later versions, would it be plausible to port
> the changes from the newer chameleon version to version 1.0.5? Although
> upgrading our version of Chameleon is a possibility, I've been asked to
> avoid doing so unless absolutely necessary, as many customizations have
> been made to it.
>
> Note: I currently have the Chameleon 1.99 b2 samples running, however
> our application is primarily for the CWC component, which does not seem
> to be fully implemented in the beta release. Upgrading may be
> considered once version 2.0 of Chameleon/CWC2 is released
>
> Steven D'Cruz
>
> (Open)GIS Developer
>
> Environment Canada
>
> Steven.D'Cruz at ec.gc.ca
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon
--
-----------------------------------------------------------------
|Paul Spencer pspencer at dmsolutions.ca |
|-----------------------------------------------------------------|
|Applications & Software Development |
|DM Solutions Group Inc http://www.dmsolutions.ca/|
-----------------------------------------------------------------
More information about the Chameleon
mailing list