Esri / geoform-template-js

GeoForm is a configurable template for form based data editing of a Feature Service.
http://esri.github.io/geoform-template-js/
Apache License 2.0
67 stars 83 forks source link

Fields - Setting VISIBLE to FALSE sets field value to NULL despite defaultValue being set #543

Open randomblink opened 6 years ago

randomblink commented 6 years ago

I have a STATUS field on my GeoForm. I have set the defaultValue to 'Pending' and the visible to false. The points I create have a STATUS of null.

I need the points to have a STATUS of 'Pending' like the defaultValue says.

If I set visible to true then the user can change the STATUS which I do not want. Why does the visible setting basically nullify the fields value?

driskull commented 6 years ago

Hey @randomblink I believe it should be setting it to the null value. Do you have an example you could share?

randomblink commented 6 years ago

For instance...

I use the GeoForm to populate the Local Government Model - Address - SiteAddressPoint. I have figured out how to generate the SITEADDID field so that it is a different entry than what is done on an ArcGIS Desktop edit session. I used the 'defaultValue' attribute like so:

"defaultValue": "GF" + new Date().getTime(),

Now I currently can "locked": true and stop the enduser from editing this field.

But what I would PREFER is for the end user to not even see this field AND have it still generate the custom field "GF" + new Date().getTime() for the SITEADDID field.

So... to sum it up...

I can either get the defaultValue I want or make the field visible:false but not both. Once a field turns invisible the defaultvalue stops working. Can this be corrected?