To self or not to self, that is the question

I have the following click handler on a (legacy) table:

text_to_translate.setValue(self.selectedRow.data.english);
await query41.trigger();
self.refresh();

The first self.selectedRow... works perfectly.

The self.refresh does not. However if I count to three and click the refresh button on the table footer the data does appear. So there is little doubt only a table refresh is needed after the call to query41.

However, if I change self.refresh() to <tablename>.refresh(), it works.

This is a pity because if self worked then this code could be used (unmodified) in another table (event handler). It's not a disaster because since each table has its own distinct event handlers it is not horrible to tweak them.

However the fact that self works on line 1 and fails on line 3 seems like a bug.

Hi Roland! That's a good point. I suspect that self works when you're trying to access data, but self doesn't support functions being called on it. I'll file a ticket now to make this behavior clearer, thank you for taking the time to report :slight_smile: