Power Table onDoubleClick getValueAt error

I receive this error message (in Diagnostics -> Console) in the Designer when I double click on my power table atempting to retreive a specific colomn value.

I can’t figure out what is my error.

Thanks for your help.

12:55:46.638 [AWT-EventQueue-0] ERROR Vision.Components.AdvancedTable - Error invoking extension method.
org.python.core.PyException: Traceback (most recent call last):
File “”, line 15, in onDoubleClick
TypeError: ‘instancemethod’ object is unsubscriptable

Line 15 ==> mypk = self.data.getValueAt[rowIndex,“pk”]

Here is my entire def code:

def onDoubleClick(self, rowIndex, colIndex, colName, value, event):
Called when the user double-clicks on a table cell.

	self: A reference to the component that is invoking this function.
	rowIndex: Index of the row, starting at 0, relative to the underlying
	colIndex: Index of the column starting at 0, relative to the
	          underlying dataset
	colName: Name of the column in the underlying dataset
	value: The value at the location clicked on
	event: The MouseEvent object that caused this double-click event
mypk = self.data.getValueAt[rowIndex,"pk"]  
system.gui.messageBox("my key is:" + str(mypk),"Test")

getValueAt is a function - you need to call it (using parentheses) not attempt a ‘subscript’ notation (using square brackets).

mypk = self.data.getValueAt[rowIndex,"pk"]
Is asking for the (rowIndex, "pk") attribute of the getValueAt method of the self.data dataset.

The correct syntax is just:
mypk = self.data.getValueAt(rowIndex,"pk")

1 Like

Oh thanks you PGriffith!

It look like I was blind this morning! :slight_smile: