[Chameleon] Table Widget and SQL Query Customization

Julien-Samuel Lacroix jlacroix at mapgears.com
Wed Mar 8 09:48:16 EST 2006


Hi,
Comments inline.

Jessica Deegan wrote:
> 1)
> I've configured a report using the table widget based on the SQL query 
> widget and would like this report to be a popup window. 
>  
> I think the best solution might be to incorporate the popup widget's 
> functionality into the table widget (creating a new widget), but I'm 
> guessing there might be a simpler solution. I've been going around in 
> circles for a few days on this and am rather stuck.

You can either incorporate a Popup in the widget or make a new page (PHP 
script or Chameleon). With a new page, like report.phtml, you would call 
it via the Link widget in a new window.

> 2)
> Is it possible to pass php variables into the SQL Query? I have 
> coordinates stored in variables to generate a spatial query, but am 
> running into parse errors when I use SQL similar to that used in 
> generating a new layer on the map, snippet as follows:
> /where the_geom && SetSRID('BOX3D($rMinX $rMaxX,$rMinY 
> $rMaxY)'::box3d,-1) AND within(the_geom, SetSRID('BOX3D($rMinX 
> $rMaxX,$rMinY $rMaxY )'::box3d,-1));/

You may create a new widget or pass the values you want in the form 
attributes with:
$oApp->moHttpFormVars->setVars('__MinX__', $value);

Then in your template, when you create the SQLQuery widget, you will 
pass the [$__MinX__$] parameter.

Julien

-- 
Julien-Samuel Lacroix
Mapgears
http://www.mapgears.com/


More information about the Chameleon mailing list