Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Make NaTable row non editable based on particular cell value.(NatTable row needs to be made non editable,)
Make NaTable row non editable based on particular cell value. [message #1428653] Mon, 22 September 2014 06:14 Go to next message
Amruta Sardeshmukh is currently offline Amruta SardeshmukhFriend
Messages: 25
Registered: September 2014
Junior Member
Based on particular value input from the user ,need to make the entire NatTable row
non editable.
Captured the user input and applied the NON EDITABLE label to the column as follows:

public void setDataValue(int columnIndex, int rowIndex,Object newValue) {
// TODO Auto-generated method stub
if(columnIndex==1 && newValue.toString().equalsIgnoreCase("no"))
{
configLabel = getConfigLabelsByPosition(columnIndex, rowIndex);
crossValidationAcc.accumulateConfigLabels(configLabel, columnIndex, rowIndex);[/i][/font]
}
super.setDataValue(columnIndex, rowIndex, newValue);
}

After applying the lable to the columnindex and rowindex need to configure the registry,Need to understand which class I need to overide to be able to apply the configuration to the NatTable ,to make the row non editable.
Re: Make NaTable row non editable based on particular cell value. [message #1428819 is a reply to message #1428653] Mon, 22 September 2014 11:53 Go to previous message
Arye Shemesh is currently offline Arye ShemeshFriend
Messages: 37
Registered: November 2012
Member
Hi Amruta,

Try adding the following configuration to your table:


		natTable.addConfiguration(new AbstractRegistryConfiguration() {


			@Override
			public void configureRegistry(IConfigRegistry configRegistry) {
				configRegistry.registerConfigAttribute(
						EditConfigAttributes.CELL_EDITABLE_RULE,
						IEditableRule.NEVER_EDITABLE,
						DisplayMode.EDIT,
						<your label for non-editable cells>);

			}

		});



Hope it helps.
Previous Topic:getCellByPosition() returning a null datavalue
Next Topic:Sample NAT table project
Goto Forum:
  


Current Time: Fri Apr 26 15:52:38 GMT 2024

Powered by FUDForum. Page generated in 0.25266 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top