/
How to Set (Cell) Values in Tables

How to Set (Cell) Values in Tables

The use case is to overwrite a cell value in a graphical table such as Interactive Table (or Free Table*).

In this example we set values for the first three columns, which are a CheckBoxesColumn, RadioBoxesCoulmn and TextFieldsColumn --- it is important to note, that setting values is only possible for these user controllable types of columns!

image-20240910-131944.png

It is also important to know that it is best to change table values ​​via the table model -- not by writing them in the result items!

(It is not crucial but better activate the “Script configures user interface“ setting in the Script.)

InteractiveTableGraph itg = jC.getComponentByName("ITG:1"); //change "ITG:1" to InteractiveTableGraphModel model = itg.getModel(); model.getColumn(0).setModelValue(2, true); model.getColumn(1).setModelValue(3, true); model.getColumn(2).setModelValue(4, 3.14159); itg.invalidateContent();

*if you have a Free Table Graph instead of an InteractiveTableGraph use FreeTableGraph & FreeTableGraphModel.

Related content

Create a Protocol Template
Create a Protocol Template
More like this
Scripting
Scripting
More like this
Calculations
Calculations
More like this
Graphics
Graphics
More like this
jBEAM 8.1.0
jBEAM 8.1.0
More like this
Scripting Tutorials
Scripting Tutorials
More like this