How can i get the value of a hidden column when row selected? Hidden columns do not appear to have a column index in the Power Table, if they do they are not in order and the table.getValueAt(row, col) requires an index not a column name.
Expression:
try({Root Container.Power Table.data}[{Root Container.Power Table.selectedRow},2],'None Selected')
Scripting
#Column Index 2 is hidden in the Table.
Table1 = event.source.parent.getComponent('Power Table')
try:
HiddenColumn = str(Table1.data.getValueAt(Table1.selectedRow,2))
event.source.parent.getComponent('Text Field 1').text=HiddenColumn
except:
event.source.parent.getComponent('Text Field 1').text="No Row Selected"
Hi Jerry,
Try using table.data.getValueAt, instead of table.getValueAt
Best,
nmudge, i tried table.data but i get “object has no attribute ‘data’”. This is a Power Table.
Hi Jerry,
That should not happen. Can you please show the full Python script?
Thanks,
I got it to work but this is the code that I was using that did not work with ‘data’.
Inside the OnDoubleClick event:
tried to get the table several ways
table = event.source
and
table = event.source.parent.getComponent(‘tableName’)
param = table.getValueAt(rowIndex, 1)
and tried
param = table.data.getValueAt(rowIndex, 1) (this gave me the data error)
What did work was simply using the ‘self’ attribute.
param = self.data.getValueAt(rowIndex, “ColumnName”)
Hi Jerry,
I understand. In the onDoubleClick extension function self and event.source are different objects. self is the table. event.source is an object created from an inner class of the table.
Best,