<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Editor multiple elements per one field breaks field on the form in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-multiple-elements-per-one-field-breaks/m-p/1473675#M84619</link>
    <description>&lt;P&gt;Hi, I added to Editor widget's form template a multiple elements (coded-value elements) per one field, and show/hide it depending on 'visibilityExpression' element's property.&lt;/P&gt;&lt;P&gt;One element of these is shown once at a time5 . But as a result field that appears with broken list of options.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What could be wrong about it?&lt;/P&gt;&lt;P&gt;This is how I present elements of the form template&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const visibilityExpressions = [
  {
    expression: 'return $originalFeature.field1 == 1;',
    name: 'field2Of1',
    returnType: 'boolean',
  },
  {
    expression: 'return $originalFeature.field1 == 2;',
    name: 'field2Of2',
    returnType: 'boolean',
  },
];

const elements = [
  {
    domain: {
      codedValues: [
        { code: 1, name: '1' },

        { code: 2, name: '2' },
          
      ],
      name: 'domainName1',
      type: 'coded-value',
    },
    fieldName: 'field1',
    label: 'Field 1',
    type: 'field',
  },
  {
    domain: {
      codedValues: [
        { code: 0, name: '0' },

        { code: 1, name: '1' },

        { code: 2, name: '2' },

        { code: 3, name: '3' },
      ],
      name: 'domainName1',
      type: 'coded-value',
    },
    fieldName: 'field2',
    label: 'Field 2',
    type: 'field',
    visibilityExpression: 'field2Of1',
  },
  {
    domain: {
      codedValues: [
        { code: 0, name: '0' },

        { code: 1, name: '1' },

        { code: 2, name: '2' },

        { code: 3, name: '3' },
      ],
      name: 'domainName2',
      type: 'coded-value',
    },
    fieldName: 'field2',
    label: 'Field 2',
    type: 'field',
    visibilityExpression: 'field2Of2',
  },
];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the list of options, instead of having five options in the dropdown list, I got one recommended&amp;nbsp; (which is not supposed to be there ) and one more (no label just code) which is a current value.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AnastasiiaD_0-1715857730305.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/104334i107FA4298566E6DC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AnastasiiaD_0-1715857730305.png" alt="AnastasiiaD_0-1715857730305.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 16 May 2024 11:10:42 GMT</pubDate>
    <dc:creator>AnastasiiaD</dc:creator>
    <dc:date>2024-05-16T11:10:42Z</dc:date>
    <item>
      <title>Editor multiple elements per one field breaks field on the form</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-multiple-elements-per-one-field-breaks/m-p/1473675#M84619</link>
      <description>&lt;P&gt;Hi, I added to Editor widget's form template a multiple elements (coded-value elements) per one field, and show/hide it depending on 'visibilityExpression' element's property.&lt;/P&gt;&lt;P&gt;One element of these is shown once at a time5 . But as a result field that appears with broken list of options.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What could be wrong about it?&lt;/P&gt;&lt;P&gt;This is how I present elements of the form template&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const visibilityExpressions = [
  {
    expression: 'return $originalFeature.field1 == 1;',
    name: 'field2Of1',
    returnType: 'boolean',
  },
  {
    expression: 'return $originalFeature.field1 == 2;',
    name: 'field2Of2',
    returnType: 'boolean',
  },
];

const elements = [
  {
    domain: {
      codedValues: [
        { code: 1, name: '1' },

        { code: 2, name: '2' },
          
      ],
      name: 'domainName1',
      type: 'coded-value',
    },
    fieldName: 'field1',
    label: 'Field 1',
    type: 'field',
  },
  {
    domain: {
      codedValues: [
        { code: 0, name: '0' },

        { code: 1, name: '1' },

        { code: 2, name: '2' },

        { code: 3, name: '3' },
      ],
      name: 'domainName1',
      type: 'coded-value',
    },
    fieldName: 'field2',
    label: 'Field 2',
    type: 'field',
    visibilityExpression: 'field2Of1',
  },
  {
    domain: {
      codedValues: [
        { code: 0, name: '0' },

        { code: 1, name: '1' },

        { code: 2, name: '2' },

        { code: 3, name: '3' },
      ],
      name: 'domainName2',
      type: 'coded-value',
    },
    fieldName: 'field2',
    label: 'Field 2',
    type: 'field',
    visibilityExpression: 'field2Of2',
  },
];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the list of options, instead of having five options in the dropdown list, I got one recommended&amp;nbsp; (which is not supposed to be there ) and one more (no label just code) which is a current value.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AnastasiiaD_0-1715857730305.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/104334i107FA4298566E6DC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AnastasiiaD_0-1715857730305.png" alt="AnastasiiaD_0-1715857730305.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 11:10:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-multiple-elements-per-one-field-breaks/m-p/1473675#M84619</guid>
      <dc:creator>AnastasiiaD</dc:creator>
      <dc:date>2024-05-16T11:10:42Z</dc:date>
    </item>
  </channel>
</rss>

