I have a simple question.
I use things like tables and the paintable canvas, and find i have to use a kludge to get them to refresh when I want them to. Is it possible to add a refresh method? I dislike using kludges because they may not work in future versions.
Use the system.db.refresh() function. Thatās the documented and supported method to refresh things on demand. (As opposed to a polling binding, etc.) Although it was created to refresh dataset bindings, it actually refreshes any binding.
I guess I donāt understand what you are trying to refresh on the table. I presumed the table data was coming from a binding. Since itās static, I donāt see what there is to refresh.
I think I see the problem. Lets say that for a chart (not easy chart) we have binded a button to the tooltips property. If the property is set to True when the client/chart is shown, then the chart will always have the tooltip active even if we deactivated it with the button. A refresh of the chart/table would be needed to update these kind of properties. Is this the problem you have ? I currently having a similar issue, if I find the soluction Ill let you know.
Pretty simple to explain:
updating a table with tabledata.setValueAt(row,column,value) sets the value, but you donāt see it until something else causes the table to refresh.
For the table update, I donāt recognize the function you mentioned - do you mean āsystem.dataset.setValue(dataset, rowIndex, columnName, value)ā?
For the paintable canvas - just call its repaint method any time. So if you were to do it from any extension function, just use event.source.repaint(). You donāt need to pass it any sort of event, itāll take care of that.
EDIT: I was writing as Phil's post below came in, but it stands that best practice is to use system.dataset.setValue() to create a new dataset with the updated value, then write it back to the table.
There's your problem. You are modifying a dataset in place. That won't generate a property change event, and therefore won't cause any update. That method is not part of the Dataset interface, and is actually intended only for construction of a dataset prior to assignment anywhere. For your code to work properly going forward, you need to use system.dataset.setValue(), and assign its return value back to the data property of the table. Like so:
Just add a custom property to the paintable canvas, unbound, and change it via scripting whenever you want to redraw. Could be as simple as a boolean that you toggle.