Select to view content in your preferred language

Bug with Editor Widget (disappearing custom fields)

2564
1
10-23-2014 07:54 AM
StephenGregory
Deactivated User

Hi all,

I may have found a bug with the Editor Widget in the JS API v3.11; I've tested this in IE9 and IE11, and it doesn't occur in the latest versions of Firefox and Chrome. The customFields disappear when two new features are added sequentially.

This occurs when creating an editor widget instance, customizing the fieldInfo's to use customFields.

var myDijit = new dijit.form.ValidationTextBox({

          regExp : "\\(?(\\d{3})\\)?[- ]?(\\d{3})[- ]?(\\d{4})",

          required : false,

          promptMessage: "Enter phone number",

          invalidMessage : "Enter valid phone number"

        });

      

        var layerInfos = [{

          'featureLayer':featureLayer,

          'showAttachments':false,

          'showDeleteButton':false,

          'fieldInfos':[

            {'fieldName':'name','label':'Name'},

            {'fieldName':'email','label':'Email'},

            {'fieldName':'phone','label':'Phone','customField':myDijit},

            {'fieldName':'note','label':'Details', 'stringFieldOption':esri.dijit.AttributeInspector.STRING_FIELD_OPTION_TEXTAREA},

            {'fieldName':'notedate','label':'Date'}

          ]

        }];  

Steps to reproduce:

  1. Add a new feature, but don't enter any text into the customFields (i.e. "Phone" in this example).
  2. Add another new feature. When the attribute inspector opens, the customField is missing.

You can test this in one of the sandbox examples: http://developers.arcgis.com/javascript/sandbox/sandbox.html?sample=ed_attributeInspectorValidate

Also note that the same behavior occurred in Chrome for v3.10 of the API, but was fixed in v3.11. See attached screenshots.

Thoughts?

0 Kudos
1 Reply
KellyHutchins
Esri Frequent Contributor

I ran a quick test and can repro the issue on IE so we'll look into that. In the  meantime I was able to workaround the problem by assigning a height to the validation field when it was created:

        var myDijit = new dijit.form.ValidationTextBox({

          regExp : "\\(?(\\d{3})\\)?[- ]?(\\d{3})[- ]?(\\d{4})",

          required : false,

          promptMessage: "Enter phone number",

          invalidMessage : "Enter valid phone number",

          style: "height:1.5em"

        });