Select to view content in your preferred language

Multiple Related Records in FlexViewer 2.2

1138
9
03-15-2011 09:21 AM
francescodi_vito
Deactivated User
Hy guys,
i would like to import the sample of Multiple Related Records in a custom widget for FlexViewer 2.2.
But i can't handle the mapclickHandler on the map FlexViewer.
How can i do?
Help me
Tags (2)
0 Kudos
9 Replies
RobertScheitlin__GISP
MVP Emeritus
Francesco,

<mx:Image click="{activateSearchTool(DrawTool.MAPPOINT)}" source="assets/images/i_draw_point.png" useHandCursor="true" buttonMode="true" toolTip="some tooltip" width="40" height="40"/>

private function activateSearchTool(value:String):void
{
 setMapAction(value, "Some status text", null, DrawEnd);
}

private function DrawEnd(event:DrawEvent):void
{
 var selectionQuery:Query = new Query();
        selectionQuery.geometry = event.graphic.geometry;
        fieldsLayer.selectFeatures(selectionQuery, FeatureLayer.SELECTION_NEW);
}
0 Kudos
francescodi_vito
Deactivated User
Thaks robert
0 Kudos
francescodi_vito
Deactivated User
Hi Robert,
i have a curiosity! In the sample  i ritrive the WMS with relationship Class into the tag <esri:Map>.
In a custom widget i have to insert my WMS with relationship class into declaration or is wrong?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Francesco,

   The declarations section is for non-visual components. If you do not have those layers already added to the map using the main config.xml than you need to add the layers to the map using action script.
0 Kudos
francescodi_vito
Deactivated User
thanks, Robert,
but i published a WMS that contain 4 tables. The tables have a relationship class with the layer oh WMS. So i would like to search any fields of tables with a expresion (ex. < 30) and zoom in on the element of related layer. This is possible by using the search widget or query widget in the FlexViewer 2.2?
Would be a pleasure to know any your ideas about this
Thanks
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Francesco,

   Question... Why are you always using WMS? Why not a regular Map Service?
0 Kudos
francescodi_vito
Deactivated User
I developed this same query that I wrote in a custom application and in that case I used a map service. But now I need to replicate the same task in a widget FV of 2.2, but I could not solve the problem using a map service;so I thought that was wrong. If I use a map service that contains the point  feature with the related tables, it's possible to use the query or search widget of FV2.2 for a query on related table and after zoom in on the feature class?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Francesco,

   No the Query and the Search Widgets without being modified do not have the ability to query related tables. But if you have a FeatureLayer that points to your map service added in your main config.xml for the Flex Viewer then you would just loop through the map.layers to find that layer and then execute the queryRelatedFeatures just like in the sample.
0 Kudos
francescodi_vito
Deactivated User
ok I'll try this way.
Thanks Robert
0 Kudos