[Chameleon] result_fields setting for query/identify

Tyler Mitchell tjm at timberline.ca
Wed Mar 30 11:18:36 EST 2005


Okay, thanks guys.  I have filed the enhancement.  I suggested to use 
the same methodology that MapServer already uses so you could re-use 
your map files without making changes to metadata.

In the meantime I will try the custom route.

Tyler

Jason Fournier wrote:
> Tyler,
> 
> I don't think the current Query widget implementation supports metadata 
> delimitation of resulting fields.  I would imagine you'd either have to 
> modify the widget to support this or hardcode expected fields in the 
> query.phtml file.
> 
> Another option would be to use the Custom Query implementation 
> (http://chameleon.maptools.org/tiki/tiki-index.php?page=QueryWidgetCustomizingResults). 
>  the query.phtml file could contain an array something like:
> 
> $aNoShow = array( 'SHAPE_INDEX', 'TILE_INDEX', 'LAYER_INDEX', 
> 'GEOMETRY', 'gml:boundedBy', 'gml:Point' );
> 
> Then when you are looping through your results you could check to see if 
> the fieldname matches your noshow values - if not then show the field:
> 
>                 foreach($aResult as $key => $aRow)
>                 {
>                     foreach($aRow as $attr => $val)
>                     {
>                         if( !in_array( $attr, $aNoShow ) )
>                         {
>                             $szResults .= "<tr><td 
> width=\"20\">&nbsp;</td>\n";
>                             $szResults .= "<td width=\"75\"><span 
> class=\"queryKey\">$attr</span></td>\n";
>                             $szResults .= "<td valign=\"top\"><span 
> class=\"queryValue\">$val</span></td></tr>\n";
>                         }
>                     }
>                 }
> 
> In this instance $aResult is the result of executeQuery().
> 
> Jason
> 
> 
> 
> Tyler Mitchell wrote:
> 
>> Is there an equivalent metadata tag I should be using to limit the 
>> fields returned from an identify?  I used to use
>> "RESULT_FIELDS" "fieldname1 fieldname2"
>> to only show certain fields.  What is the method for doing this with 
>> the identify widget?
>>
>> Tyler
>> _______________________________________________
>> Chameleon mailing list
>> Chameleon at lists.maptools.org
>> http://lists.maptools.org/mailman/listinfo/chameleon
>>
> 


More information about the Chameleon mailing list