Uploaded image for project: 'Nuxeo Studio'
  1. Nuxeo Studio
  2. NXS-4604

Wrong scaffolding for multivalued floating point complex type in Chrome

    XMLWordPrintable

    Details

      Description

      Steps to reproduce:

      • Create a schema:
        • Filter
          • locations (Complex & multivalued)
            • latitude (Floating point)
            • longitude (Floating point)
      • Associate the schema with a document type
      • Create the edit and/or create layout for your document type
      • View designer creates this source for you:
          <nuxeo-data-table items="{{document.properties.Filter:locations}}" orderable="true" editable="true" role="widget" size="0" scroll-throttle="60" max-items="10000">
      
            <nuxeo-data-table-column name="[[i18n('label.doctype.nxdtfilter.locations.latitude')]]">
              <template>
                [[item.latitude]]
              </template>
            </nuxeo-data-table-column>
      
            <nuxeo-data-table-column name="[[i18n('label.doctype.nxdtfilter.locations.longitude')]]">
              <template>
                [[item.longitude]]
              </template>
            </nuxeo-data-table-column>
      
            <nuxeo-data-table-form>
              <template>
                <nuxeo-input value="{{item.latitude}}" label="[[i18n('label.doctype.nxdtfilter.locations.latitude')]]" type="number"></nuxeo-input>
                <nuxeo-input value="{{item.longitude}}" label="[[i18n('label.doctype.nxdtfilter.locations.longitude')]]" type="number"></nuxeo-input>
              </template>
            </nuxeo-data-table-form>
          </nuxeo-data-table>
      

      You can't introduce a decimal value. It's detected as an invalid value.

      The scaffolder process must add step="any" to the underlying paper-input to those fields that are defined as floating poing in Nuxeo Studio:

          <nuxeo-data-table items="{{document.properties.Filter:locations}}" orderable="true" editable="true" role="widget" size="0" scroll-throttle="60" max-items="10000">
      
            <nuxeo-data-table-column name="[[i18n('label.doctype.nxdtfilter.locations.latitude')]]">
              <template>
                [[item.latitude]]
              </template>
            </nuxeo-data-table-column>
      
            <nuxeo-data-table-column name="[[i18n('label.doctype.nxdtfilter.locations.longitude')]]">
              <template>
                [[item.longitude]]
              </template>
            </nuxeo-data-table-column>
      
            <nuxeo-data-table-form>
              <template>
                <nuxeo-input value="{{item.latitude}}" label="[[i18n('label.doctype.nxdtfilter.locations.latitude')]]" type="number" step="any"></nuxeo-input>
                <nuxeo-input value="{{item.longitude}}" label="[[i18n('label.doctype.nxdtfilter.locations.longitude')]]" type="number" step="any"></nuxeo-input>
              </template>
            </nuxeo-data-table-form>
          </nuxeo-data-table>
      

      https://github.com/nuxeo/nuxeo-ui-elements/blob/ab37fd0019e91cc4ab4bf5ecea93528c85f63945/widgets/nuxeo-input.html must chage to support step attibute (similar to this):

      <paper-input id="paperInput"
                       type="[[type]]"
                       name="[[name]]"
                       value="{{value}}"
                       placeholder$="[[placeholder]]"
                       error-message="[[errorMessage]]"
                       autofocus$="[[autofocus]]"
                       readonly$="[[readonly]]"
                       disabled$="[[disabled]]"
                       required$="[[required]]"
                       minlength$="[[minlength]]"
                       maxlength$="[[maxlength]]"
                       min$="[[min]]"
                       max$="[[max]]"
                       step$="[[step]]"
                       pattern$="[[pattern]]"
                       auto-validate$="[[autoValidate]]"
                       validator$="[[validator]]"
                       invalid$="[[invalid]]"
                       step$="[[step]]"
                       no-label-float>
          </paper-input>
      

      See: https://www.isotoma.com/blog/2012/03/02/html5-input-typenumber-and-decimalsfloats-in-chrome/

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: