Widget tag

This page describes an older version, please read about the latest version at:
http://resources.arcgis.com/en/help/flex-viewer/concepts/

Functionality in the ArcGIS Viewer for Flex application is defined by widgets. A widget is a chunk of code that can be added to the Viewer in a modular fashion. Widgets can be added to, and removed from, the Viewer application as desired. The following image is of a widget icon:

Example of a widget icon

The widget tag, <widget>, defines a widget in the Viewer application. It can be referenced in a Viewer application configuration file either as an independent widget or within a widget container, which determines the widget's behavior in the Viewer user interface (UI).

Learn more about widgets in the ArcGIS Viewer for Flex

<widget> has the following attributes:

The last six attributes of <widget> (left, right, top, bottom, horizontalcenter, and verticalcenter) relate to the position of the widget's dialog window when it first opens with respect to the Viewer application window. Basically, the widget dialog window location is referenced with respect to the application window edges, so if the application window is resized, the widget dialog window will always remain visible relative to the application window extent. This approach to application layout referencing is called constraint layout. See the following screen capture:

Marked up screen capture showing the left/right/top/bottom layout constraints.

The following screen captures show two example placements of the GeoRSS widget dialog window, based on the right and bottom attributes:

Screen captures showing different widget dialog window placement.

The following config.xml file code sample shows the widget placement differences for the two graphics:

...
<!-- Widget in screen capture on the left -->
<widget right="350" bottom="75" config="widgets/GeoRSS/GeoRSSWidget.xml" url="widgets/GeoRSS/GeoRSSWidget.swf"/>
...
<!-- Widget in screen capture on the right -->
<widget right="75" bottom="350" config="widgets/GeoRSS/GeoRSSWidget.xml" url="widgets/GeoRSS/GeoRSSWidget.swf"/>
...
2/15/2012