How to add custom text box to WAB app

3517
22
Jump to solution
08-07-2017 03:37 PM
RodKuhns
New Contributor II

I have a custom WAB application that zooms to a parcel feature upon startup using URL parameters passed in.   I would like to add a Text Box, Title Box or some type of HTML table to display information about the feature, such as Parcel ID, Owner name, County, Township, Range, Section etc.    This could be displayed on top of the map, covering a portion of the map in a corner, or in a dedicated area above the map.  Can anyone provide some suggestions about how I might go about adding this type of labeling that will come from a JavaSript function?  I have the function to retrieve the data elements, I'm in need of ideas on how to display them on the WAB interface.

Thanks!

Rod Kuhns

GIS Applications Architect, MBS

0 Kudos
22 Replies
GeorgeKatsambas
Occasional Contributor III

In the widget.js or the config, this is not a css rule? Basically I am asking where do I add the code lol

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

George,

  No this is not a css rule so it goes in the widget.js in the startup or in the onclose function of the splash widget. All depends on your desired workflow.

0 Kudos
GeorgeKatsambas
Occasional Contributor III

I am inserting it in widget.js in splash under widget correct?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Correct

0 Kudos
GeorgeKatsambas
Occasional Contributor III

OK Robert, I am going to bother you 1 last time  at which line add the code and why I keep on getting a syntax error  

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

George,

  I would have to see what you have done. I am not sure which line of code as I am providing general advice.

0 Kudos
GeorgeKatsambas
Occasional Contributor III

I am looking for help on where exactly to add the code that will give me a text box on my screen and the correct syntax

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

George,

define(['dojo/_base/declare',
    'dojo/_base/lang',
    'dojo/_base/html',
    'dojo/on',
    'dojo/keys',
    'dojo/query',
    'dojo/cookie',
    'dijit/_WidgetsInTemplateMixin',
    'jimu/BaseWidget',
    'dojo/topic',
    'jimu/dijit/CheckBox',
    'jimu/utils',
    'esri/lang',
    'jimu/dijit/LoadingShelter',
    'dojo/Deferred',
    'jimu/dijit/Message'
  ],
  function(declare, lang, html, on, keys, query, cookie, _WidgetsInTemplateMixin, BaseWidget, topic,
           CheckBox, utils, esriLang, LoadingShelter, Deferred, Message) {
....‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍


      close: function() {
        this._isClosed = true;
        this._eventHide();
        this.widgetManager.closeWidget(this);
        new Message({
          titleLabel: "your title",
          message: "Hello World"
        });
      },
0 Kudos
GeorgeKatsambas
Occasional Contributor III

I am copying and pasting as above, keep on getting a syntax error, can i add this to the start 

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

No replace just the text portions provided. The ... mean there is more code that I did not include so leave that portion alone.