formio.js icon indicating copy to clipboard operation
formio.js copied to clipboard

refreshOn attribute doesn't work

Open amirmf opened this issue 8 years ago • 13 comments

if you create a select component and fill the values with custom js and set the refreshOn you will see it doesn't work

amirmf avatar Sep 13 '18 15:09 amirmf

Hello Amir,

This is William with the Form.io support team. Thanks for reaching out.

We fixed a bug with the latest release that does resolve an issue with refreshOn where it would stop working after the first trigger. Try the latest release of 3.5.2.

Please let me know if you have any further questions or concerns.

Thanks,

William Gay Form.io Developer Support

wag110894 avatar Sep 14 '18 18:09 wag110894

Hi William,

I'm on latest 3.6.0 version but I have issue on refreshOn not updating .. I'm linking to "Url Source based" lists with on is the parent "City" and child "Neighbor" ..

Still, it doesn't refresh on new city selection ..

Here's the neighbor list schema:

{
  "label": "Neighbor ",
  "mask": false,
  "tableView": true,
  "type": "select",
  "key": "neighborId",
  "input": true,
  "data": {
    "url": "/api/Lookup/GetNeighbors",
  },
  "dataSrc": "url",
  "refreshOn": {
    "label": "City",
    "value": "cityId"
  },
  "clearOnRefresh": true,
  "validate": { ... },
}

abarrak avatar Oct 10 '18 14:10 abarrak

Hello Abdullah, This is William with the form.io support team. Thanks for reaching out.

We have one of our developers investigating this issue. We will let you know what they find out. We would love to connect hear about your project and see how we can help. Additionally, our on premise deployment allows you to deploy our entire platform within your own infrastructure giving you complete control over your data.

And finally, we also have support packages available for training, support or development services if you are interested!

Please let me know if you have any further questions or concerns.

Thanks, William Gay Form.io Developer Support

wag110894 avatar Oct 11 '18 21:10 wag110894

Thank you William, really appreciate the followup !

Could the issue because of refreshOn binding, to be single value string with the key name?

abarrak avatar Oct 14 '18 08:10 abarrak

Have you tried the latest release? The last change that I made to the renderer fixes an issue with the refreshOn handler.

travist avatar Oct 14 '18 16:10 travist

Thank you @travist. I was on the latest release.

After additional examination, it appears refreshOn only supports single key values only. Above it was linked automatically with fetched list item object { label: .., value: }

Setting valueProperty on the list component didn't solve it, but specifying refreshOn: 'cityId' did.

abarrak avatar Oct 15 '18 17:10 abarrak

Glad to hear you got the issue figured out.

Please let me know if you have any further questions or concerns.

Thanks,

William Gay Form.io Developer Support

wag110894 avatar Oct 16 '18 19:10 wag110894

This is still not working in my case. Is there any solution for it?

rishabh47 avatar Oct 30 '18 05:10 rishabh47

Hello Rishabh,

Can you please clarify what you mean by "not working"? This will help us find the source of the issue.

Please let me know if you have any further questions or concerns.

Thanks, William Gay Form.io Developer Support

wag110894 avatar Oct 30 '18 13:10 wag110894

Another followup on refreshOn behavior 😅

I noticed that if the controls where inside data-grid, the dependant control doesn't work (not firing with parent changes).

abarrak avatar Oct 31 '18 16:10 abarrak

Hello,

Can you provide an example form? If you have a select controller referencing a resource, for example, you will need to make sure you are referencing ‘row’ and not ‘data’ to populate the data or values.

Please let me know if you have any further questions or concerns.

Thanks,

wag110894 avatar Nov 01 '18 18:11 wag110894

Thank you very much @wag110894 !

~using contextual row variable fixed the refresh:~

refreshOn: 'row.cityId'

Update:

We can't reference row, [i], or {{row.x}} in refreshOn. Only simple keys. It is supported in filter with Handlerbar syntax filter: '{{ row.x }}' , though.

Inside a gird, you can just write: refreshOn: 'cityId' & it will link magically to the current row's cityId.

abarrak avatar Nov 05 '18 09:11 abarrak

Yep, I found the same issue when you use refresh on event in grid element. It bind a incorrect key.

jimmy201602 avatar Mar 15 '19 09:03 jimmy201602