formio / formio.js

JavaScript powered Forms with JSON Form Builder
https://formio.github.io/formio.js
MIT License
1.9k stars 1.07k forks source link

[BUG] Select box - remote data #1679

Closed pixie79 closed 5 years ago

pixie79 commented 5 years ago

Hi,

We have a bug with 4.0.3 where select box's that are remote URL appear to not render the components correctly when you go back into edit the select box.

I have copied the json schema below and will send over a screenshot to go with it.

Regards

Mark

Json schema for the select box.

{
  "id": "e0w38p",
  "key": "strategy",
  "data": {
    "url": "{$.environmentContext.referenceDataUrl}/v2/entities/strategy",
    "json": "",
    "custom": "",
    "values": [],
    "headers": [
      {
        "key": "",
        "value": ""
      }
    ],
    "resource": ""
  },
  "sort": "label.asc",
  "tags": [],
  "type": "select",
  "input": true,
  "label": "strategy themes",
  "limit": 100,
  "logic": [],
  "filter": "",
  "hidden": false,
  "prefix": "",
  "suffix": "",
  "unique": false,
  "widget": "choicesjs",
  "dataSrc": "url",
  "dbIndex": false,
  "lockKey": true,
  "overlay": {
    "top": "",
    "left": "",
    "style": "",
    "width": "",
    "height": ""
  },
  "tooltip": "",
  "disabled": false,
  "lazyLoad": false,
  "multiple": false,
  "redrawOn": "",
  "tabindex": "",
  "template": "<span>{{ item.strategy }}</span>",
  "validate": {
    "json": "",
    "custom": "",
    "required": false,
    "customMessage": "",
    "customPrivate": false
  },
  "autofocus": false,
  "encrypted": false,
  "hideLabel": false,
  "indexeddb": {},
  "minSearch": 0,
  "protected": false,
  "refreshOn": "",
  "tableView": true,
  "attributes": {},
  "errorLabel": "",
  "labelWidth": 20,
  "persistent": true,
  "properties": {},
  "validateOn": "change",
  "clearOnHide": true,
  "conditional": {
    "eq": "",
    "json": "",
    "show": "",
    "when": ""
  },
  "customClass": "",
  "description": "Themes linked to the strategy",
  "fuseOptions": {
    "include": "score",
    "threshold": 0.3
  },
  "labelMargin": 3,
  "placeholder": "",
  "searchField": "",
  "authenticate": false,
  "defaultValue": "",
  "disableLimit": false,
  "selectFields": "",
  "selectValues": "data",
  "alwaysEnabled": false,
  "customOptions": {},
  "labelPosition": "top",
  "readOnlyValue": false,
  "searchEnabled": true,
  "showCharCount": false,
  "showWordCount": false,
  "valueProperty": "id",
  "calculateValue": "",
  "clearOnRefresh": false,
  "searchThreshold": 0.3,
  "selectThreshold": 0.3,
  "customConditional": "",
  "allowMultipleMasks": false,
  "customDefaultValue": "",
  "allowCalculateOverride": false
}
Screenshot 2019-09-12 at 17 00 07
jeriah-formio commented 5 years ago

@pixie79 Thank you for the report. We were able to replicate this issue on our end as well and have a created a ticket for the issue and will review during our planning meeting next week. Please note, we welcome pull requests in this library. If you need this item expedited, please feel free to contact support@form.io for pricing.

aminmc commented 5 years ago

This is the same problem with file components:

Screenshot 2019-09-14 at 20 38 53

I configured the URL when I created the form but when I edit the component I don't see the option to modify the URL. If I look at the raw json I can see the url:

Screenshot 2019-09-14 at 20 40 24
jeriah-formio commented 5 years ago

@aminmc Thank you for the additional info. We will add this to the ticket.

pixie79 commented 5 years ago

Links to 1687 I think

aminmc commented 5 years ago

@jhen1422 @pixie79 tested against 4.2.0-rc.1 and I can see the correct behaviour.