1. Get started

  2.  Welcome
  3.  Get started
  4.  Run as a Windows service
  5.  Build your first app
  6.  Requirements
  7.  Accessibility support
  8.  Development overview
  9.  About release versions
  10.  What's new
  11.  Frequently asked questions
  12. Working with apps

  13.  Home page
  14.  Create or import an app
  15.  Edit and launch an app
  16.  Choose a theme
  17.  Select a map or scene
  18.  Add widgets
  19.  Widgets overview
  20.  Configure app attributes
  21.  Preview apps on smaller screens
  22.  Export as a template
  23.  Edit or preview template
  24.  Use URL parameters
  25.  Upgrade apps
  26. Configure 2D widgets

  27.  About widget
  28.  Add Data widget
  29.  Analysis widget
  30.  Attribute Table widget
  31.  Batch Attribute Editor widget
  32.  Basemap Gallery widget
  33.  Bookmark widget
  34.  Business Analyst widget
  35.  Chart widget
  36.  Controller widget
  37.  Coordinate widget
  38.  Coordinate Conversion widget
  39.  Cost Analysis widget
  40.  Data Aggregation widget
  41.  Directions widget
  42.  Distance and Direction widget
  43.  District Lookup widget
  44.  Draw widget
  45.  Edit widget
  46.  Emergency Response Guide widget
  47.  Extent Navigate widget
  48.  Filter widget
  49.  Full Screen widget
  50.  Geocoder widget
  51.  GeoLookup widget
  52.  Geoprocessing widget
  53.  Grid Overlay widget
  54.  Gridded Reference Graphic widget
  55.  Group Filter widget
  56.  Image Measurement widget
  57.  Home Button widget
  58.  Incident Analysis widget
  59.  Infographic widget
  60.  Info Summary widget
  61.  Layer List widget
  62.  Legend widget
  63.  Measurement widget
  64.  My Location widget
  65.  Near Me widget
  66.  Network Trace widget
  67.  Oblique Viewer widget
  68.  Overview Map widget
  69.  Parcel Drafter widget
  70.  Print widget
  71.  Public Notification widget
  72.  Query widget
  73.  Related Table Charts widget
  74.  Report Feature widget
  75.  Reviewer Dashboard widget
  76.  Scalebar widget
  77.  Screening widget
  78.  Search widget
  79.  Select widget
  80.  Share widget
  81.  Situation Awareness widget
  82.  Smart Editor widget
  83.  Splash widget
  84.  Stream widget
  85.  Suitability Modeler widget
  86.  Summary widget
  87.  Swipe widget
  88.  Threat Analysis widget
  89.  Time Slider widget
  90.  Visibility widget
  91.  Zoom Slider widget
  92. Configure 3D widgets

  93.  3DFx widget
  94.  About widget
  95.  Basemap Gallery widget
  96.  Compass widget
  97.  Coordinate widget
  98.  Daylight widget
  99.  Full Screen widget
  100.  Home Button widget
  101.  Layer List widget
  102.  Legend widget
  103.  Measurement widget
  104.  My Location widget
  105.  Navigate widget
  106.  Search widget
  107.  Share widget
  108.  Slides widget
  109.  Splash widget
  110.  Zoom Slider widget
  111. Widget development

  112.  Get started
  113.  Naming conventions
  114.  In-panel and off-panel widgets
  115.  Deploy your widget
  116.  Required files
  117.  Widget manifest
  118.  Extend BaseWidget
  119.  Required properties
  120.  Define the template
  121.  Configure the Demo widget
  122.  Add i18n support
  123.  Make widgets user-friendly
  124.  Build your first app
  125.  Communication to app container
  126.  Widget properties
  127.  Make widgets responsive
  128.  Communication between widgets
  129.  Dojo dijit
  130.  Make widgets configurable in builder
  131.  Make widgets backward compatible
  132.  Create a controller widget
  133.  Widget life cycle
  134.  Add help for your widget
  135.  Create a feature action in your widget
  136.  Provide and consume data sources in widgets
  137.  Best practices for unit testing
  138. Theme development

  139.  Theme elements
  140.  Create a theme
  141. 3D development

  142.  3D development guide
  143. Sample code

  144.  Create a custom in-panel widget
  145.  Create a ListView widget
  146.  Create a custom widget using the Report dijit
  147.  Create a new theme
  148.  Create a new style for a theme
  149.  Create a new default layout
  150.  Create a nondefault layout
  151.  Create a new panel
  152.  Create a new layout widget
  153.  Create a controller widget
  154.  Create a feature action in your widget
  155.  Send a layer to the Attribute Table widget
  156.  Open multiple widgets simultaneously
  157.  Use other libraries
  158.  Change the URL of ArcGIS API for JavaScript
  159. Deployment

  160.  Deploy your app
  161.  Use proxy
  162.  Web-tier authentication
  163.  Custom widget and theme deployment
  164.  Upgrade custom widgets and themes
  165. Framework reference

  166.  CSS framework
  167.  FeatureActionManager class
  168.  FilterManager class
  169.  LayerInfo class
  170.  LayerInfos class
  171.  LayerNode class
  172.  LayerStructure class
  173.  PanelManager class
  174.  SelectionManager class
  175.  Utils class
  176.  WidgetManager class
  177. dijit

  178.  FeaturelayerChooserFromMap class
  179.  FeaturelayerServiceBrowser class
  180.  FeatureSetChooserForSingleLayer class
  181.  Filter class
  182.  ImageChooser class
  183.  ItemSelector class
  184.  LayerChooserFromMap class
  185.  RendererChooser class
  186.  Report class
  187.  SnapShot class
  188.  SymbolChooser class
  189. JSON reference

  190.  App configuration
  191.  Map configuration
  192.  Widget configuration
  193.  Widget pool configuration
  194.  Widget on-screen configuration
  195.  Panel configuration
  196.  Group configuration
  197.  DataSource configuration
  198.  About
  199.  Analysis
  200.  Attribute Table
  201.  Basemap Gallery
  202.  Bookmark
  203.  Chart
  204.  Coordinate
  205.  Directions
  206.  Draw
  207.  Edit
  208.  Full Screen
  209.  Geocoder
  210.  Geoprocessing
  211.  Controller
  212.  Home Button
  213.  Image Measurement
  214.  Infographic
  215.  Layer List
  216.  Legend
  217.  Loading Page
  218.  Measurement
  219.  My Location
  220.  Near Me
  221.  Oblique Viewer
  222.  Overview Map
  223.  Print
  224.  Query
  225.  Report Feature
  226.  Reviewer Dashboard
  227.  Scalebar
  228.  Search
  229.  Share
  230.  Splash
  231.  Stream
  232.  Swipe
  233.  Time Slider
  234.  Zoom Slider
  235. What's new archive

  236.  What's new in version 2.23
  237.  What's new in version 2.22
  238.  What's new in version 2.21
  239.  What's new in version 2.20
  240.  What's new in version 2.19
  241.  What's new in version 2.18
  242.  What's new in version 2.17
  243.  What's new in version 2.16
  244.  What's new in version 2.15
  245.  What's new in version 2.14
  246.  What's new in version 2.13
  247.  What's new in version 2.12
  248.  What's new in version 2.11
  249.  What's new in version 2.10
  250.  What's new in version 2.9
  251.  What's new in version 2.8
  252.  What's new in version 2.7
  253.  What's new in version 2.6
  254.  What's new in version 2.5
  255.  What's new in version 2.4
  256.  What's new in version 2.3
  257.  What's new in version 2.2
  258.  What's new in version 2.1
  259.  What's new in version 2.0
  260.  What's new in version 1.3
  261.  What's new in version 1.2
  262.  What's new in version 1.1

Create a new default layout

This topic explains how to create a new default layout. To understand the basic concepts of a layout and its components in Web AppBuilder, as well as the differences between the default and non-default layouts, see Layouts.

Create a new default layout folder structure

Steps:
  1. Go to the layouts folder in the theme where the new layout will be created, such as ~/client/stemapp/themes/<YourTheme>/layouts.
  2. Create a new folder and name it default.

    If you create a new default layout for an existing theme, make a copy of the original default layout folder first.

  3. Create a new config.json file in the default folder.
  4. Add icon images representing the layout in Web AppBuilder.

    The folder structure should look like the following:

    New default layout folder structure

Register the new layout in manifest.json

To show the new layout in Web AppBuilder, register it in the theme's manifest.json file.

TipTip:

You can skip this section if you're creating a new default layout for an existing theme as it should have already been registered in the manifest.json file.

Steps:
  1. Open the manifest.json file at~/client/stemapp/themes/YourTheme/manifest.json.
  2. Add the following information about the default layout to the layouts:
    • “name”—Must match the name of the layout folder. It is the default in this case.
    • “description”—The description of the layout.

    The code snippet in the manifest.json file should look similar to the following:

    {
      "name": "default",
      "description": "this is the default layout"
    }
    

  3. Reload Web AppBuilder.

    The new layout appears under the theme as shown below:

    New registered layout

Create a minimal layout structure in config.json

A typical default layout structure contains the following components:

  • widgetOnScreen—Includes layout properties for widgets placed on the UI, such as a controller, predefined widgets, and widget placeholders.
  • map—Defines the position of the map.
  • widgetPool—Includes a list of widgets placed in the controller widget if there is a controller defined in the widgetOnScreen section.
  • mobileLayout—Optional. It provides the layout for mobile devices, overriding the properties configured in the widgetOnScreen, map, and widgetPool sections.
Steps:
  1. Open the config.json file at ~/client/stemapp/themes/YourTheme/layouts/default/config.json.
  2. Add the following code snippet:
    {
      "widgetOnScreen": {
        "widgets": []
      },
      "map": {},
      "widgetPool": {
        "panel": {}
      }
    }
    
  3. In Web AppBuilder, create a new app with the new layout.

    The app should show nothing but a map.

Add a controller widget

Most out-of-the-box themes come with a controller widget. In this example, the HeaderController widget from the Foldable or Jewelry Box theme is added to the default layout.

Steps:
  1. Make sure the widget's folder exists in the theme folder, and copy the HeaderController widget folder from the Foldable or Jewelry Box theme into it.
    HeaderController widget folder structure
  2. In the config.json file, add the HeaderController widget to the widgetOnScreen section, and configure its properties.

    For a full list of widget properties, see Widget configuration.

    {
      "widgetOnScreen": {
        "widgets": [
          {
            "uri": "themes/YourTheme/widgets/HeaderController/Widget",
            "position": {
              "left": 40,
              "top": 40,
              "right": 40,
              "height": 40,
              "relativeTo": "browser"
            }
          }
        ]
      },
    
      "map": {},
    
      "widgetPool": {
        "panel": {}
      }
    }
    

    In this layout, the HeaderController is positioned 40 pixels away from the top and left and right sides of the screen.

    NoteNote:
    The layout system of Web AppBuilder uses absolute positioning. The top, left, right, bottom, and zIndex properties are equivalent to the top, left, right, bottom, and z-index properties in CSS.

Configure position properties for the map

In this layout, the map will use the entire screen.

Steps:
  1. Add the following code snippet for the map:
    {
      "widgetOnScreen": {
        "widgets": [
          {
            "uri": "themes/YourTheme/widgets/HeaderController/Widget",
            "position": {
              "left": 40,
              "top": 40,
              "right": 40,
              "height": 40,
              "relativeTo": "browser"
            }
          }
        ]
      },
    
    "map": {
        "position": {
          "left": 0,
          "top": 0,
          "right": 0,
          "bottom": 0
        }
      },
    
      "widgetPool": {
        "panel": {}
      }
    }
    

    Legend and Layer List widgets in the header are automatically added by Web AppBuilder. They are not part of the layout.

    Map uses the entire screen

Add more on-screen widgets

In this step, both the ZoomSlider and MyLocation widgets are added to the layout along with the widget placeholders.

Steps:
  1. Open the config.json file. Add layout properties for the ZoomSlider and MyLocation widgets in the same way you did for the HeaderController widget.
    {
      "widgetOnScreen": {
        "widgets": [
          { ... },
          {
            "uri": "widgets/ZoomSlider/Widget",
            "position": {
              "top": 70,
              "left": 20
            }
          },
          {
            "uri": "widgets/MyLocation/Widget",
            "position": {
              "left": 20,
              "top": 140
            }
          }
        ]
      },
    
      "map": { ... },
    
      "widgetPool": {
        "panel": {}
      }
    }
    
  2. Add widget placeholders by defining their position properties.
    {
      "widgetOnScreen": {
        "widgets": [
          { ... },
          { ... },
          { ... },
          {
            "position": {
              "left": 20,
              "top": 190
            }
          },
          {
            "position": {
              "left": 20,
              "top": 240
            }
          },
          {
            "position": {
              "left": 20,
              "top": 290
            }
          }
        ]
      },
    
      "map": { ... },
    
      "widgetPool": {
        "panel": {}
      }
    }
    

    In this example, three widget placeholders are added to the layout config file.

    More on-screen widgets

Add predefined widgets to the header

The widgets in the widgetPool section are automatically added to the app when the layout is selected. Their behavior is managed by the controller widgets.

The following widgets will be added to the widgetPool:

  • BasemapGallery
  • About

Steps:
  1. In the widgetPool section, add a new property called widgets, and give it a value of an empty array.
    "widgetPool": {
      "panel": {},
      "widgets": []
    }
    
  2. Add layout properties for both the BasemapGallery and the About widgets in the widgets array, similar to the widgets in the widgetOnScreen section.
    "widgetPool": {
        "panel": {},
        "widgets": [
          {
            "uri": "widgets/BasemapGallery/Widget"
          },
          {
            "uri": "widgets/About/Widget"
          }
        ]
      }
    

    The purpose of defining properties in the widgets array is to populate the widget icon in the header panel by the HeaderController widget. As a result, the position properties are not defined here.

  3. Add other optional properties.
    1. Use a different icon for the BasemapGallery widget.

      By default, Web AppBuilder uses a path to the widget icon, which can be overridden by the icon property defined in a widget’s layout configuration.

      "widgetPool": {
          "panel": {},
          "widgets": [
            {
              "uri": "widgets/BasemapGallery/Widget",
              "icon": "uri/to/new_icon.png"
            },
            {
              "uri": "widgets/About/Widget"
            }
          ]
        }
      
    2. Change the widget label.

      By default, Web AppBuilder reads the label text from a path to the widget/nls folder if needed. The text can be overridden by adding a label property to the widget’s layout configuration. In this example, the default label “Basemap Gallery” for the BasemapGallery widget will be changed to “Select a basemap:”.

      "widgetPool": {
        "panel": {},
          "widgets": [
            {
              "uri": "widgets/BasemapGallery/Widget",
              "icon": "uri/to/new_icon.png",
              "label": "Select a basemap:"
            },
            {
              "uri": "widgets/About/Widget"
            }
          ]
        }
      

    When the BasemapGallery widget opens in Web AppBuilder, the header text of the widget's panel is shown as follows:

    Select a basemap text displays

    NoteNote:

    There are other properties that can be added to a widget’s configuration. For a full list of available properties, see Widget configuration. The addition of other properties is dependent on the controller widget honoring those properties.

Change the default panel in the widgetPool

Widgets in the widgetPool are wrapped in a panel when they open. The default panel is BaseWidgetPanel. In this step, you'll use the FoldablePanel to display widgets in the widgetPool.

NoteNote:

This also applies to the widgets in the widgetOnScreen section.

Steps:
  1. Copy the FoldablePanel folder at ~/client/stemapp/themes/FoldableTheme/panels, and paste it into the ~/client/stemapp/themes/YourTheme/panels folder if the panel widget does not exist in the target directory.
  2. Import the FoldablePanel CSS style sheet into ~/client/stemapp/themes/YourTheme/common.css as shown below.

    @import url ("panels/FoldablePanel/style.css"):

    This step is optional if the panel widget folder does not include its own style sheet.

  3. Add the FoldablePanel widget to the panel section.
    "widgetPool": {
        "panel": {
          "uri": "themes/YourTheme/panels/FoldablePanel/Panel",
          "position": {
            "top": 70,
            "right": 20,
            "bottom": 10,
            "width": 300
          }
        },
        "widgets": [{...}, {...}]
      }
    
    Display FoldablePanel

Use a different panel in the widgetPool

The panel widget added in the previous step applies to all widgets in the widgetPool. This step shows how a specific widget uses a panel other than the default. The SimpleBorderPanel will display the About widget.

NoteNote:

This also applies to the widgets in the widgetOnScreen section.

Steps:
  1. Make sure the SimpleBorderPanel folder is in the ~/client/stemapp/themes/YourTheme/panels folder. If not, copy one from DemoTheme at ~/client/stemapp/themes/DemoTheme/panels.
  2. In the widgetPool, add a groups property as follows:
    "widgetPool": {
        "panel": {...},
        "widgets": [{...}, {...}],
        "groups": []
      }
    
  3. Add a new object in the following structure to the groups array:
    "widgetPool": {
        "panel": {...},
        "widgets": [{...}, {...}],
        "groups": [{
          "panel": {},
          "widgets": []
        }]
      }
    
  4. Move the About widget configuration from the widgetPool widgets array to the widgets array in groups as follows:
    "widgetPool": {
        "panel": {...},
        "widgets": [{...}],
        "groups": [{
          "panel": {},
          "widgets": [{
            "uri": "widgets/About/Widget"
          }]
        }]
      }
    
  5. Add the SimpleBorderPanel configuration to the panel property in the first object in groups as follows:
    "widgetPool": {
        "panel": {...},
        "widgets": [{...}],
        "groups": [{
          "panel": {
            "uri": "themes/YourTheme/panels/SimpleBorderPanel/Panel",
            "position": {
              "top": 70,
              "right": 20,
              "width": 200,
              "height": 200
            }
          },
          "widgets": [{
            "uri": "widgets/About/Widget"
          }]
        }]
      }
    
    About widget with SimpleBorderPanel

Add a layout for mobile devices

The configuration in this step is a subset of what you've done in the previous steps.

In a mobile layout, you can only define the positions of the widgets and groups with either array or object type as follows:

  • With array, you must define the position of the widget and group individually.
  • With object, you can use both the widget URI as a key and position as a value to define the position. For the placeholder widget without a URI, use ph_<i> as the key, where <i> is the index of the placeholder defined in the widgetOnScreen section. For the group, use g_<i> as the key, where <i> is the index of the group. The index starts from 0. In this example, you'll use the second method to override the positions.

Do the following to add a layout for devices:

  • Remove the spaces between the HeaderController widget and the edges of the screen.
  • Place the ZoomSlider and MyLocation widgets at the bottom right of the screen.
  • Place widget placeholders at the bottom left of the screen.

Steps:
  1. In the mobileLayout, add widgetOnScreen as a new property with its value as an object and widgets property inside of widgetOnScreen with a value as an object as well.
    "mobileLayout": {
        "widgetOnScreen": {
          "widgets": {}
        }
      }
    
    CautionCaution:

    For the default layout, the widget's property inside the mobileLayout is an array.

  2. Add the HeaderController layout configuration to the widget's object.
    "mobileLayout": {
        "widgetOnScreen": {
          "widgets": {
            "themes/YourTheme/widgets/HeaderController/Widget": {
              "position": {
                "left": 0,
                "top": 0,
                "right": 0,
                "height": 40,
                "relativeTo": "browser"
              }
            }
          }
        }
      }
    

    The widget configuration structure is an object, where the widget URI serves as the key of the object.

  3. Move the ZoomSlider and MyLocation widgets to the bottom right.
    "mobileLayout": {
        "widgetOnScreen": {
          "widgets": {
            "themes/YourTheme/widgets/HeaderController/Widget": {...},
            "widgets/ZoomSlider/Widget": {
              "position": {
                "bottom": 30,
                "right": 20
              }
            },
            "widgets/MyLocation/Widget": {
              "position": {
                "right": 20,
                "bottom": 100
              }
            }
          }
        }
      }
    
  4. Move the widget placeholders to the bottom left.
    "mobileLayout": {
        "widgetOnScreen": {
          "widgets": {
            "themes/DemoThemeTest/widgets/HeaderController/Widget": {...},
            "widgets/ZoomSlider/Widget": {...},
            "widgets/MyLocation/Widget": {...},
            "ph_3": {
              "position": {
                "left": 20,
                "bottom": 130
              }
            },
            "ph_4": {
              "position": {
                "left": 20,
                "bottom": 80
              }
            },
            "ph_5": {
              "position": {
                "left": 20,
                "bottom": 30
              }
            }
          }
        }
      }
    

    Here is the result on an iPhone 6.

    New layout on iPhone 6