formio / angular-material

JSON powered forms for Angular Material
https://form.io
MIT License
45 stars 39 forks source link

mat-formio renderer: refreshing data in select dropdown when another field changes. [BUG] #125

Open fsahar786 opened 4 years ago

fsahar786 commented 4 years ago

I have issue in mat-formio renderer select dropdown component. I am trying to Refresh data of dropdown when another field changes but unable to do so. property in formiojs is name as "Refresh Options On" and JSON property refreshOn this option s working properly if i use formio tag instead of mat-formio then dropdowns are working fine. Please help me solving this issue.

Environment

// Example Form

  {
         "label":"Columns",
         "columns":[
            {
               "components":[
                  {
                     "label":"Billing Country",
                     "fieldMapping":"",
                     "placeholder":"Billing Country",
                     "description":"",
                     "dataTags":"BillingCountry",
                     "customClass":"",
                     "hidden":false,
                     "autofocus":false,
                     "disabled":false,
                     "dataSrc":"url",
                     "data":{
                        "values":[
                           {

                           }
                        ],
                        "resource":"",
                        "url":"http://localhost:4009/api/v1/Countries",
                        "headers":[
                           {
                              "key":"",
                              "value":""
                           }
                        ],
                        "json":"",
                        "custom":""
                     },
                     "valueProperty":"Id",
                     "template":"<span>{{ item.Title }}</span>",
                     "searchEnabled":true,
                     "readOnlyValue":false,
                     "customOptions":{

                     },
                     "type":"select",
                     "selectValues":"Result",
                     "minSearch":0,
                     "tableView":true,
                     "alwaysEnabled":false,
                     "input":true,
                     "key":35,
                     "reorder":false,
                     "mask":false,
                     "selectThreshold":0.3,
                     "lazyLoad":false,
                     "disableLimit":false,
                     "reference":false,
                     "hideOnChildrenHidden":false,
                     "prefix":"",
                     "suffix":"",
                     "multiple":false,
                     "protected":false,
                     "unique":false,
                     "persistent":true,
                     "clearOnHide":true,
                     "refreshOn":"",
                     "redrawOn":"",
                     "modalEdit":false,
                     "labelPosition":"top",
                     "errorLabel":"",
                     "tooltip":"",
                     "isEntityProperty":false,
                     "hideLabel":false,
                     "tabindex":"",
                     "dbIndex":false,
                     "customDefaultValue":"",
                     "calculateValue":"",
                     "widget":null,
                     "attributes":{

                     },
                     "allowCalculateOverride":false,
                     "encrypted":false,
                     "showCharCount":false,
                     "showWordCount":false,
                     "properties":{

                     },
                     "allowMultipleMasks":false,
                     "clearOnRefresh":false,
                     "limit":100,
                     "filter":"",
                     "searchField":"",
                     "authenticate":false,
                     "selectFields":"",
                     "searchThreshold":0.3,
                     "fuseOptions":{
                        "include":"score",
                        "threshold":0.3
                     },
                     "id":"ezx4dcq",
                     "defaultValue":""
                  }
               ],
               "width":6,
               "offset":0,
               "push":0,
               "pull":0,
               "type":"column",
               "input":false,
               "hideOnChildrenHidden":false,
               "key":"column",
               "tableView":true,
               "label":"Column"
            },
            {
               "components":[
                  {
                     "label":"Billing State",
                     "fieldMapping":"",
                     "placeholder":"Billing State",
                     "description":"",
                     "dataTags":"BillingState",
                     "customClass":"",
                     "hidden":false,
                     "autofocus":false,
                     "disabled":false,
                     "dataSrc":"url",
                     "data":{
                        "values":[
                           {

                           }
                        ],
                        "resource":"",
                        "url":"http://localhost:4009/api/v1/StatesByCountry/{{row[35]}}",
                        "headers":[
                           {
                              "key":"",
                              "value":""
                           }
                        ],
                        "json":"",
                        "custom":""
                     },
                     "valueProperty":"Id",
                     "template":"<span>{{ item.Title}}</span>",
                     "searchEnabled":true,
                     "readOnlyValue":false,
                     "customOptions":{

                     },
                     "type":"select",
                     "selectValues":"Result",
                     "minSearch":0,
                     "input":true,
                     "key":17,
                     "tableView":true,
                     "hideOnChildrenHidden":false,
                     "prefix":"",
                     "suffix":"",
                     "multiple":false,
                     "protected":false,
                     "unique":false,
                     "persistent":true,
                     "clearOnHide":true,
                     "refreshOn":35,
                     "redrawOn":"",
                     "modalEdit":false,
                     "labelPosition":"top",
                     "errorLabel":"",
                     "tooltip":"",
                     "isEntityProperty":false,
                     "hideLabel":false,
                     "tabindex":"",
                     "dbIndex":false,
                     "customDefaultValue":"",
                     "calculateValue":"",
                     "widget":null,
                     "attributes":{

                     },
                     "allowCalculateOverride":false,
                     "encrypted":false,
                     "showCharCount":false,
                     "showWordCount":false,
                     "properties":{

                     },
                     "allowMultipleMasks":false,
                     "clearOnRefresh":true,
                     "limit":100,
                     "lazyLoad":false,
                     "filter":"",
                     "searchField":"",
                     "authenticate":false,
                     "selectFields":"",
                     "searchThreshold":0.3,
                     "fuseOptions":{
                        "include":"score",
                        "threshold":0.3
                     },
                     "id":"etm2zkh",
                     "defaultValue":""
                  }
               ],
               "width":6,
               "offset":0,
               "push":0,
               "pull":0,
               "type":"column",
               "input":false,
               "hideOnChildrenHidden":false,
               "key":"column",
               "tableView":true,
               "label":"Column"
            }
         ],
         "mask":false,
         "tableView":false,
         "alwaysEnabled":false,
         "type":"columns",
         "input":false,
         "key":"7",
         "conditional":{
            "show":"",
            "when":"",
            "json":"",
            "eq":""
         },
         "reorder":false,
         "properties":{

         },
         "customConditional":"",
         "logic":[

         ],
         "placeholder":"",
         "prefix":"",
         "customClass":"",
         "suffix":"",
         "multiple":false,
         "defaultValue":null,
         "protected":false,
         "unique":false,
         "persistent":false,
         "hidden":false,
         "clearOnHide":false,
         "refreshOn":"",
         "labelPosition":"top",
         "description":"",
         "errorLabel":"",
         "tooltip":"",
         "hideLabel":false,
         "tabindex":"",
         "disabled":false,
         "autofocus":false,
         "dbIndex":false,
         "customDefaultValue":"",
         "calculateValue":"",
         "widget":null,
         "validateOn":"change",
         "validate":{
            "required":false,
            "custom":"",
            "customPrivate":false,
            "strictDateValidation":false
         },
         "overlay":{
            "style":"",
            "left":"",
            "top":"",
            "width":"",
            "height":""
         },
         "allowCalculateOverride":false,
         "encrypted":false,
         "showCharCount":false,
         "showWordCount":false,
         "allowMultipleMasks":false,
         "tree":false,
         "autoAdjust":false,
         "hideOnChildrenHidden":false,
         "id":"e7napb",
         "redrawOn":"",
         "modalEdit":false,
         "isEntityProperty":false,
         "fieldMapping":"",
         "dataTags":"",
         "attributes":{

         },
         "path":"7",
         "IsRequired":false
      },
abdullahqudeer commented 4 years ago

I am facing the same issue , may be there is some issue in library ....

tamaserdfalvi commented 3 years ago

Still persists :(