Widget tag
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:
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:
- General attributes
- label—Name of the widget. This value becomes the widget title in the dialog window if it is contained within the widget template. It is also the widget's ToolTip in the widget tray of the HeaderController widget.
- icon—Icon used for the widget in the widget
tray. If the widget is not stored in a widget container, its icon
is not displayed in the widget tray. The icon is also displayed in
the upper left corner of the widget dialog window (when the widget
is "open") and when the widget is "minimized". The
default icon, i_widget.png, is shown here:
- preload—Determines if the widget is "activated" when the Viewer application initially opens. It can have one of two states: open or minimized. Widgets, by default, are loaded on demand, that is, not preloaded at all.
- config—Location path of the widget configuration file.
- url—Universal resource locator (URL) of the widget's .swf file.
- height—Height of the widget. Only works for widgets that use WidgetTemplate (Bookmark, Data Extract, Draw, Edit, Geoprocessing, GeoRSS, Layer List, Legend, Locate, Print, Query, Search, and Time widgets). [Added in version 2.4.]
- width—Width of the widget. Only works for widgets that use WidgetTemplate (Bookmark, Data Extract, Draw, Edit, Geoprocessing, GeoRSS, Layer List, Legend, Locate, Print, Query, Search, and Time widgets). [Added in version 2.4.]
- Attributes for widget position
- left—Number of pixels from the left side edge of the application window.
- right—Number of pixels from the right side edge of the application window.
- top—Number of pixels from the top edge of the application window.
- bottom—Number of pixels from the bottom edge of the application window.
- horizontalcenter—Pixel distance between the widget center point and the application center point; a negative number moves the component left from the center. [Added in version 2.4.]
- verticalcenter—Pixel distance between the widget center point and the application center point; a negative number moves the component up from the center. [Added in version 2.4.]
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:
The following screen captures show two example placements of the GeoRSS widget dialog window, based on the right and bottom attributes:
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"/>
...