def runAction(self, event):
# Grab the values to place in new DB row.
Parent = self.parent.parent.parent.getChild("containerLineMachine").getChild("labelLineName").props.text
SAP = self.parent.parent.parent.getChild("containerSapLabel").getChild("SAP Label").props.text
CommonName = self.parent.parent.parent.getChild("containerLineMachine").getChild("labelCommonName").props.text
Note = self.parent.parent.getChild("CoordinateContainer").getChild("NewCommentTextArea").props.text
# Use those values in the Insert Comment Named Query.
system.db.runNamedQuery("InsertMachineComment", {"myParent":Parent, "mySAP":SAP, "myCommonName":CommonName, "myNote":Note})
# Refresh the table to immediately bring in the new row.
system.db.refresh(event.source.parent.getChild("CommentHistoryTable"), "data")
Ok, what am I doing wrong here?
On Click of the 'Save' button appears to do nothing. This is an event script onActionPerformed on my 'Save' button.
If you look at the logs in the gateway there is a good chance it will tell you exactly what the problem is, or at least point you to the line in fault.
Not discrediting this by any means, but why would you do this when you can use a logger to log to the wrapper file, or for temporary debugging use system.perspective.print() (or just print for vision) and print messages directly to the output console?
I find loggers difficult to use. Switch to the browser, stop the live view, try and find the logger, scroll right across because it doesn't wrap.
The tag can be monitored on the Tag Browser pane.
Maybe I've missed something in my learning Igniton but I've searched and never found a good tutorial on the logger. I have a tremendous fund of ignorance to draw from!
One advantage of the writing-to-a-tag approach is you get feedback inside the designer; no need to open the gateway webpage. But it is definitely easier to get richer info via the logs.
Ok I am struggling to get the table to refresh after save:
def runAction(self, event):
# Grab the values to place in new DB row.
Parent = self.parent.parent.parent.getChild("containerLineMachine").getChild("labelLineName").props.text
SAP = self.parent.parent.parent.getChild("containerSapLabel").getChild("SAP Label").props.text
CommonName = self.parent.parent.parent.getChild("containerLineMachine").getChild("labelCommonName").props.text
Note = self.parent.parent.getChild("CoordinateContainer").getChild("NewCommentTextArea").props.text
# Use those values in the Insert Comment Named Query.
system.db.runNamedQuery("Machine Comments Panel/InsertMachineComment", {"myParent":Parent, "mySAP":SAP, "myCommonName":CommonName, "myNote":Note})
# Refresh the table to immediately bring in the new row.
system.refreshBinding(self.parent.parent.getChild("CommentHistoryTable").props.data)
# Clear text field
self.parent.parent.getChild("CoordinateContainer").getChild("NewCommentTextArea").props.text = ""
Gateway log tells me Line 12 "object has no attribute 'refreshBinding'"