Uploaded image for project: 'Nuxeo Elements'
  1. Nuxeo Elements
  2. ELEMENTS-480

nuxeo-selectivity.data must map consistently to selectivity.[data or items]

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.1.3
    • Fix Version/s: None
    • Component/s: Widgets

      Description

      Depending on either you provide a value directly to the element:

      <template>
        <nuxeo-selectivity id='pkgsSelector' data='[{"id":"id1", "text":"text1"}]'>
      </template>
      

      Or later on, after first paint, for example:

      <template>
      <nuxeo-selectivity id='pkgsSelector' data='[[testRonan]]'>
      
      attached: function() {
        Polymer.RenderStatus.beforeNextRender(this, function() { 
          this.testRonan = [{id: "toto", text: "tototext", displayLabel: "totodisplaylabel"}];
        });
      },
      

      the nuxeo-selectivity.data is used to filled _selectivity.data or _selectivity.items.

       _dataChanged: function() {
        this._selectivity && this._selectivity.setOptions({items: this._wrap(this.data)});
      },
      
      if (this.data) {
        options.data = this.data;
      } else {
      ...<snip>...
      this._selectivity = new InputType(options);
      

      The line above, showing how to set the value after first paint, is a workaround in case you want to map nuxeo-selectivity.data to _selectivity.items (note: this makes selectivity ignore the query parameter, and all resolution/suggestion is done locally, based on _selectivity.items).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                rdaniellou Ronan Daniellou
                Participants:
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: