Showing or hiding columns in a table

You can alternatively hide and show columns in a table by using the method setColumnVisible . This method takes as its parameters the IlpAttribute object of the affected column and a Boolean value setting the visibility to true or false . The attribute can be retrieved from the table model or from the table view using the method getColumn.

How to show or hide columns in a table

The following example shows how to show and hide columns in a table.
IlpTable tableComponent = new IlpTable();
// This table will contain Network Elements
IlpClass acceptedClass = IltNetworkElement.GetIlpClass();
tableComponent.setAcceptedClass(acceptedClass);
...
// Retrieve the IlpAttribute corresponding to the name in
// IltNetworkElement class
IlpAttribute nameAttr = acceptedClass. getAttribute("name");
// Hide the column
tableComponent.setColumnVisible(nameAttr, false) ;
// Show the column again
tableComponent.setColumnVisible(nameAttr, true) ;
The method isColumnVisible indicates whether the column specified by attribute is visible.
Note
The visibility of a column can also be controlled through the visible property. For more information, see Customizing column headers and rows.