How to extract the value of the selected row

Hi,
Suppose you have table in a for with some records and you select a row. How do you get the value stored in the selected row and in a particular column and place that value in a text box ?

Thanks
Francisco

Try this: Get value of specfic cell in a table?

See the “Working With Different Datatypes” in the user manual. Specifically -

Accessing data in a DataSet
DataSets have various properties and functions that you can access through Python.
• rowCount - returns the number of rows in the dataset
• columnCount - returns the number of columns in the dataset
• getColumnName(index) - returns the name of the column at the given index
getValueAt(row, column) - returns the value from the dataset at the given location. column can be either an integer or a column name, which is treated case-insensitive.

You will want to grab the dataset out of the table, then call getValueAt(table.selectedRow, table.selectedColumn) on it.

Assume this code was on a button:

table = event.source.parent.getComponent(“Table”)
textField = event.source.parent.getComponent(“Text Field”)
data = table.data
textField.text = data.getValueAt(table.selectedRow,table.selectedColumn)

how to print the values from the database table by some condition.


I am able to print headers, how to print values.

Thank you

I wrote a helper function for that.

Also available in module form, if you want a system.dataset.print: