[Chameleon] Problems with Query Widget Customizing Results

Sašo Celarc Saso.Celarc at snt.si
Wed Aug 24 11:28:41 EDT 2005


Thanks for response, Jason.

I have only one form in template. Below is the code snippet (by View Source in browser). You can see, hidden variables are set. As you can see the sid is set twice (in line 01 and line 33). But when the the value of sid is displayed (line 46) the result is "undefined". On the other hand the hidden variable CURSOR_TYPE (line 47) is displeyed fine (value AUTO). 

01<form><input type="hidden" name="sid" value="430c8e94f1115" />
02 <INPUT TYPE=HIDDEN NAME=NAV_INPUT_TYPE VALUE="">
03 <INPUT TYPE=HIDDEN NAME=NAV_INPUT_COORDINATES VALUE="">
04
05<input type="hidden" name="NAV_INPUT_SUBMIT" value="">
06 <INPUT TYPE=HIDDEN NAME=MAP_EXTENTS_MINX VALUE="445500">
07
08 <INPUT TYPE=HIDDEN NAME=MAP_EXTENTS_MINY VALUE="79000">
09
10 <INPUT TYPE=HIDDEN NAME=MAP_EXTENTS_MAXX VALUE="458500">
11
12 <INPUT TYPE=HIDDEN NAME=MAP_EXTENTS_MAXY VALUE="92000">
13
14<INPUT TYPE=HIDDEN NAME=MAP_WIDTH VALUE="600">
15
16<INPUT TYPE=HIDDEN NAME=MAP_HEIGHT VALUE="600">
17
18 <INPUT TYPE=HIDDEN NAME=MAP_CURSOR_POS_X VALUE="">
19
20 <INPUT TYPE=HIDDEN NAME=MAP_CURSOR_POS_Y VALUE="">
21
22 <INPUT TYPE=HIDDEN NAME=NAV_CMD VALUE="">
23
24 <INPUT TYPE=HIDDEN NAME=NAV_SUBMIT VALUE="1">
25
26 <INPUT TYPE=HIDDEN NAME=MAP_ORIGINAL_EXTENTS VALUE="445500,79000,458500,92000">
27
28 <INPUT TYPE=HIDDEN NAME=MAP_ORIGINAL_PROJ VALUE="">
29
30 <INPUT TYPE=HIDDEN NAME=CURSOR_TYPE VALUE="">
31
32<INPUT TYPE='HIDDEN' NAME='NAV_ALLOW_RECTANGLE' VALUE='true'>
33 <INPUT TYPE=HIDDEN NAME=sid VALUE="430c8e94f1115">
34 <INPUT TYPE=HIDDEN NAME=UPDATE_MAP VALUE="0">
35 <INPUT TYPE=HIDDEN NAME=LEGENDTEMPLATE_RESET VALUE="">
36
37 <INPUT TYPE="HIDDEN" NAME="LEGENDTEMPLATE_LAYERS" VALUE="TTN 50.000~~Letalski posnetek~~Meje naselij~~Meja občine">
38
39<INPUT TYPE=HIDDEN NAME=BUTTON_TOOLSET_Navigation VALUE="cwcimage_14">
40 <INPUT TYPE="HIDDEN" NAME="LANGUAGE" VALUE="en-CA">
41  <script language="JavaScript" type="text/javascript">
42    function customQueryResult( nX, nY )
43    {
44      var url = 'query.php?x=' + nX + '&y=' + nY + '&sid=' + document.forms[0].sid.value;
45      alert(url);
46      alert(document.forms[0].sid.value);            
47      alert(document.forms[0].CURSOR_TYPE.value);    
48      window.open(url, null, "width=500, height=400, directories=no, location=no, menubar=no, scrollbars=no, status=no, toolbar=no, resizable=no")      
49    } 
50  </script>
...
...

Regards,
Sašo



-----Original Message-----
From: chameleon-bounces at lists.maptools.org [mailto:chameleon-bounces at lists.maptools.org] On Behalf Of Jason Fournier
Sent: Wednesday, August 24, 2005 3:08 AM
To: chameleon at lists.maptools.org
Subject: Re: [Chameleon] Problems with Query Widget Customizing Results

Sašo,

Do you have more than one form in your calling template?  If so you will 
have to reference the proper form (ie, the one that contains sid).

document.forms[0].sid.value should exist if you only have one form.  If 
you look in the source of the Chameleon application do you see the sid 
hidden variable?

Jay



Sašo Celarc wrote:
> Hi !
> 
>  
> 
> I followed the instructions in 
> http://chameleon-tiki.maptools.org/tiki-index.php?page=QueryWidgetCustomizingResults 
> but I get the message >Your session is invalid or has expired.< in the 
> query results popup window.
> 
>  
> 
> I echoed the variables and the value:
> 
> document.forms[0].sid.value  
> 
> in expression:
> 
> var url = 'query.php?x=' + nX + '&y=' + nY + '&sid=' + 
> document.forms[0].sid.value;
> 
> has value >undefined<,
> 
> so I call the url:
> 
> window.open("query.php?x=321&y=305&sid=undefined", null, "width=500, 
> height=400, directories=no, location=no, menubar=no, scrollbars=no, 
> status=no, toolbar=no, resizable=no").
> 
>  
> 
> I think, that this >undefined< causes the >Your session is invalid or 
> has expired.< error. The default QueryWidget works OK.
> 
>  
> 
> Where is the problem ?
> 
>  
> 
> Regards,
> 
> Saso Celarc
> 
>  
> 
>  
> 
> 
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.338 / Virus Database: 267.10.14/79 - Release Date: 22.8.2005
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon

-- 
________________________
Jason Fournier

DM Solutions Group Inc.
jfournier at dmsolutions.ca
www.dmsolutions.ca
613.565.5056 x18
_______________________________________________
Chameleon mailing list
Chameleon at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/chameleon


-- 
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.10.14/79 - Release Date: 22.8.2005
 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.10.14/79 - Release Date: 22.8.2005
 



More information about the Chameleon mailing list