refreshBinding not working

Need a fresh set of eyes on this. I feel like this should work but can’t seam to figure out why it wont.I have a table which is being populated with a quary binding. Then i’m using a textfield and button to add and delete from the database table which works fine. And then after either adding or deleting I wanted to refresh the binding so that the entry will appear in the table instantly. But this step I can’t get to work. Code below

    logger = system.util.getLogger("AddDeviceType")
    logger.info("Hello MR script, we meat again")
    
    name = self.getSibling("NameTextField").props.text
    
    system.db.runNamedQuery("DeviceType/InsertDeviceType", {"name":name})
    
    table = self.parent.parent.parent.getChild("DeviceTypeTable")
    table.refreshBinding("props.data")

Turns out that if you make a named query to insert, delete, update and so on. You have to specify it as an update query. The problem was that the named query was specified as a normal Query(select) and thus was stuck waiting for a response that never came.

Somehow I always manage to stumble onto these weird things :smiley:

1 Like