AnsweredAssumed Answered

Customizing the GeoForm with a Concatenator option

Question asked by bokeefe on Apr 6, 2018
Latest reply on Apr 24, 2018 by bokeefe

So I have a need for a GeoForm that will concatenate multiple fields into a single field.

 

Currently I am using the GeoForm to create 'Pending Addresses' inside the Site Address Points from the Local Government Model.

 

I have already worked with the GeoForm GIT Editors and they have customized the form to offer the ability to 'Lock' a field so that it is VISIBLE but not EDITABLE to EndUsers. Basically, in the JSON under [form folder]/config/default.js you can create an assortment of attributes for 'fields' made available in the form. The KEY attribute being the "name" attribute which identifies the Feature Class field this HTML form will be pushed into.

 

Well, using the newly updated [form folder]/js/main.js file you can now add "locked": true and that field will be greyed out and uneditable to end users. Something MUCH needed for my current (and many future) project(s).

 

ANYWAY... since I was able to visibly see the Javascript used to add this functionality to the GeoForm I have decided to try my hand out at editing the [form folder]/js/main.js file to add another functionality that is GREATLY needed for this form.

 

CONCATENATION

 

Think "THIN" Attribute Assistant for the GeoForm. (very thin)

 

Basically, in this current instance (Site Address Points) I want to be able to display the FULLADDR and FULLNAME fields from SiteAddressPoints AND have them Auto-Populate with the concatenated contents from other fields.

 

Specifically from ADDRNUM, PREADDRNUM, STREETNAME, STREETTYPE, ADDRNUMSUF, UNITTYPE, UNITID

 

So... this is my goal. I'm going to be asking a LOT of questions as this is the first for me in a long time for working with Javascript, first forever in working with Dojo, and I am hoping this will lead to more custom development in my group.

 

So my questions are as follows:

 

  1. How would I format my JSON in [form folder]/config/default.js?
  2. How would I set that form field to auto-populate from a concatenated collection of other form fields?
  3. How would I make that concatenation editable?
    (i.e., How do I allow the concatenation to do things like FIELD1 + " " + FIELD2 + ", " + FIELD3)
  4. I know I need to edit [form folder]/js/main.js but I feel like I will need a custom Method/function and I'm not sure where the best place to put that would be? (i.e., in a separate file, at the bottom of main.js, etc)

 

I am numbering them so that answers can be assigned to those numbers.

 

As I need to get this process moving I have also posted this question over at Stack Exchange in case anyone else is following this and also uses Stack Exchange.

Outcomes