Repeater - Data Not Refreshing

Wappler Version : 1.9.7
Operating System : Windows 10

Expected behavior

Calling a server connect’s load event should update the data shown on the UI.

Actual behavior / How to reproduce

A repeat children section is set with server connect as the data source.
User enters some data. Clicks save to submit the form. The data is NOT updated on the server for some reason. Response is 200 (which is how my system works).
On response, I re-load the source server connect of repeater.
The text box still shows the old value - even thought the dmx-bind:value is set to server connect data field.


The issue, from what I understand is that the data in UI is not updated if the response data of server connect is same as current values.
So in this case, old value & new value for the text-box’s field is same - hence it does not update the value via dmx, and the value shown in UI is still the one user had entered which did not save.

Is there any way to force-reload the UI dmx-bind values? OR clear out the repeater, so it re-creates all elements in the UI?

1 Like

Hi @nshkrsh,
Is this an update record form?

Because if the data is not inserted, and you reload the server action on done, it will reload the values from the query and will show the old ones.

Also - how do you do that exactly? On what event you call what action?

Hi Teodor.

This is the structure:
Repeat Children > Card > Form > Collapse > Textbox etc. & Submit Button

So each child in the repeater has a form of its own.

So on submit type save button, server connect form gets submitted automatically.
Then, on success of form, I call server connect’s load method.
This server connect is bound with the repeater.

On page load, this server connect is is auto-loaded.

Have you tried on done instead, as onsuccess expects a success status, and you say it’s not updating the data?

If there is any new data, that is correctly being added to the repeater as additional element.
So data from server connect IS updating the repeater.

Is just that if I have made any changes on one of the rows of repeater, those values are retained and not reset to value from server connect.

You totally lost me here.
What exactly are you doing:

  1. Inserting data from outside the repeater which reloads the data in the repeater when inserted in the db

OR

  1. Updating data inside the repeater which is supposed to update data in the database and refresh the query returning the data from the database?

I am doing both.
I was just giving a clarification that JSON data is updating - only not reflecting in the UI.

So, for both the cases that you have mentioned, if there are some client side changes, they are retained in the UI.

I still don’t really understand the idea behind this.
You update the data in your database, but you then want to refresh the data returned from the database? What’s the point of doing that?
You update “abc123” in the database, and you already have “abc123” in the input because you just used it to update the data.

That’s half correct. I try to update value to “abc123”, but it fails. So when I reload the server connect the value returned is “abc” (original value). But, the input still shows “abc123”.

Then you’d better check why the update fails first :smiley: that’s the real problem on your page.

Also - I cannot reproduce the problem here - i.e. the data always reloads in the inputs in my repeat region.

That is under-testing. :slight_smile:
But, it should not affect the issue I am trying to report.

Messaging you a link.

1 Like

An update for the community: Teodor could see the issue, but it requires further investigation to know its exact nature & fix it. :slight_smile:

2 Likes