Updating template repeater dataset from repeated template

Hi,

I have a template repeater that shows a recipe’s steps as per screenshot below. When in edit mode, the operator is able to delete a step using the X on the right. The X manipulates the SQL table by effectively removing the step at that index and then re-indexing the remaining steps so that they’re sequential again.
The template repeater SQL binding set to not polled, as I don’t want it updating all the time.

The issue I have is that when I delete a row, it doesn’t update to reflect the changes.

How can I perform a refresh (system.db.refresh) on the templateParams dataset after clicking the X?
I don’t want to hard code this by using something like system.gui.getParentWindow(event).rootContainer.getComponent(“group”).getComponent(“Template Repeater”)… etc.

Thanks in advance.

Nick

Hi Nick,

Even if you do a system.db.refresh on the correct templates, it will not update other clients.

What I usually do is create a memory tag to act as a trigger (a boolean is best, as it simplifies the caching that often happens on various layers). I use that memory tag somewhere in the query WHERE clause, and when it’s clicked, I not that tag, so the query parameters change, and the query is evaluated again.

SELECT myData
FROM myTable
WHERE {triggerTag} = {triggerTag}
2 Likes

Thanks Sander, that’s a really good idea! I will start doing this from now on with all my tables. Cheers for the reply