[Chameleon] Widgets or JSAPI (Modifying Customized Query Results)

Jason Fournier jfournier at dmsolutions.ca
Wed Aug 17 17:43:32 EDT 2005


My bad ... I confused this functionality with SimplePrint - you would 
use the actual Query widget with POPUPRESULTS="false":

<cwc2 type="Query" visible="true" styleresource="NavButton" 
popupstyleresource="TextButton" popupresults="false" iframename="" 
image="icons/icon_query.png" imagetip="Query Point" toolset="Navigation" 
popupwidth="450" popupheight="400" Toolbar="false" Status="false" 
Menubar="false" RADIUS="3">
                         <image state="normal"/>
                         <image state="hover"/>
                         <image state="selected"/>
                       </cwc2>

This will get captured by the Event Manager because it's actually a query.




Seiple, Timothy E wrote:
>  
> Does the Link widget have map querying functionality? When I click on
> the button generated by the Link Widget the cbLocation() executes
> immediately (e.g. without any x,y values).  There is no opportunity to
> click on the map.  How is the ON_QUERY event being triggered?
> 
> 
> -----Original Message-----
> From: chameleon-bounces at lists.maptools.org
> [mailto:chameleon-bounces at lists.maptools.org] On Behalf Of Jason
> Fournier
> Sent: Wednesday, August 17, 2005 11:28 AM
> To: chameleon at lists.maptools.org
> Subject: Re: [Chameleon] Widgets or JSAPI (Modifying Customized Query
> Results)
> 
> Your template would contain:
> 
> 1) goEventManager entry in the onload of your template:
> 
> goEventManager.registerForEvent( 'ON_QUERY', 'cbLocation' );
> 
> 2) You would place a link widget (javascript, not href) in your template
> that refers to cbLocation as the js callback.
> 
> 3) cbLocation would be somewhere inside script tags in your template:
> 
> <script>
> 
>   function cbLocation()
>   {
>         var nX = document.formname.CursorPos_X.value;
>         var nY = document.formname.CursorPos_Y.value;
>         window.opener.document.formname.nXLocation.value = nX;
>         window.opener.document.formname.nYLocation.value = nY;
>         self.close();
>   }
> 
> </script>
> 
> 4) Place CursorPos widgets in the template somwhere.
> 
> 
> The order of events would be:
> 
> 1) User clicks a button in your regular html application that launches a
> chameleon instance/app.
> 2) User clicks on the 'select location' button (ie, the link widget you
> put in the template).  Alternatively I believe you can make this button
> selected by default.
> 3) User selectes location on the map.
> 4) The callback (cbLocation) gets fired because you've registeres
> ON_QUERY in your onload.
> 5) cbLocation grabs the location from the CursorPos widget and pass
> those variables back to the opener (your other app).
> 6) Chameleon closes itself.
> 
> 
> I don't think the ON_QUERY has made it to the documentation just yet.  I
> happen to know about it because I helped put it there.
> 
> Jay
> 
> _______________________________________________
> 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


More information about the Chameleon mailing list