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

Refresh individual components?

Open chdonncha opened this issue 1 year ago • 3 comments

I've an issue where I need individual components to be refreshed without a page reload.

There's a ticket from sometime back that asked a similar question but there was no update or workaround on this that was addressed as far as I know - https://github.com/formio/formio.js/issues/4030

Is this possible in formio or is there any known work arounds to facilitate that?

chdonncha avatar Aug 09 '24 16:08 chdonncha

Currently it is impossible to refresh individual components without a page reload. We have created a ticket for this feature to be added to our platform. For reference, the ticket number is FIO- 3450.

Tatsiana8 avatar Aug 14 '24 13:08 Tatsiana8

I'd like to note that this is has been on the backlog for a long time and isn't expected to be addressed in the near future but we would be happy to review any contributions that might add this functionality.

lane-formio avatar Aug 14 '24 17:08 lane-formio

As a workaround for the moment I've been attempting doing a redraw of the individual components after the latest data has been fetched but only redrawing the desired components.

I'm able to redraw the main form but attempting a redraw with individiual components seems to show no result:

myForm.loadFormData(form)
    .then(() => {

  const containerComp = form.getComponent('myComponent');

  myComponent.redraw();

}

where If I just redraw the form itsself I will fetch the latest data and redraw all components with the latest data but then it applies to all components:

myForm.loadFormData(form)
    .then(() => {

  form.redraw();

}

chdonncha avatar Aug 19 '24 16:08 chdonncha