Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-24471

Directory entry is not formatted after adding to a data table

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 9.10
    • Fix Version/s: 9.10-HF05, 10.2
    • Component/s: Web UI
    • Release Notes Summary:
      Directory entries are displayed with their label when added to a data table in the Web UI.
    • Tags:
    • Backlog priority:
      700
    • Browser:
    • Upgrade notes:
      Hide

      Use selected-item(s) property from the suggestion widget instead of the value one in order to make it work

      Show
      Use selected-item(s) property from the suggestion widget instead of the value one in order to make it work
    • Sprint:
      nxGang Sprint 10.1.6, nxGang Sprint 10.2.2
    • Story Points:
      3

      Description

      Consider a schema with a multivalued complex field defined with a Directory field and a String field

        <xs:element name="edition" type="nxs:book_editionListType"/>
        <xs:complexType name="book_editionListType">
          <xs:sequence>
            <xs:element name="item" type="nxs:book_editionType" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
        <xs:complexType name="book_editionType">
          <xs:sequence>
            <xs:element name="year" type="xs:string"/>
            <xs:element name="editor">
              <xs:simpleType>
                <xs:restriction base="xs:string" ref:resolver="directoryResolver" ref:directory="editors"/>
              </xs:simpleType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      

      The code below is used to add a value to this complex field and is based on a nuxeo-data-table element.

          <nuxeo-data-table items="{{document.properties.book:edition}}" page-size="40" editable="" empty-label="noResults">
            <nuxeo-data-table-column name="[[i18n('editions')]]" flex="150">
              <template>[[formatDirectory(item.editor)]]</template>
            </nuxeo-data-table-column>
            <nuxeo-data-table-column name="[[i18n('name')]]" flex="150">
              <template>[[item.year]]</template>
            </nuxeo-data-table-column>
            <nuxeo-data-table-form>
              <template>
                <nuxeo-directory-suggestion dbl10n="" required="" class="col-12" min-chars="0" directory-name="editors" value="{{item.editor}}">
                </nuxeo-directory-suggestion>
                <nuxeo-input value="{{item.year}}">
                </nuxeo-input>
              </template>
            </nuxeo-data-table-form>
          </nuxeo-data-table>
      

      After adding the new value to the data table, the directory value is not formatted: it displays the key instead of the label, whereas the other values (previously added) are correctly displayed.

      Please look at the 2 attached screenshots which highlight the bug.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 days
                  2d

                    PagerDuty

                    Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.