Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Setting certain cells in an editable table column to non-editable doesn't work
Setting certain cells in an editable table column to non-editable doesn't work [message #1067916] Thu, 11 July 2013 08:48 Go to next message
Urs Beeli is currently offline Urs Beeli
Messages: 330
Registered: October 2012
Location: Bern, Switzerland
Senior Member
We have a table with some editable columns. The cells in this column are marked with a little grey triangle in the upper left corner and if I click in it, I can modify the content of the cell.

However, we have certain business rules which decides if a row in the table can be changed or not (depending on the content of the row).

I added the following code to the editable cells:
@Override
protected void execDecorateCell(Cell cell, ITableRow row) throws ProcessingException {
  if (someBusinessLogic(getCriteriaColumn().getValue(row))) {
    cell.setEditableInternal(false);
  }
}


However, this does not have the desired result. Those cells that should be editable still show the triangle and they are editable. But those cells that should not be editable are still editable, even though they no longer show the triangle.

It seems that the triangle-indicator is updated correctly, but the effective editable-property of the cell is not.

Am I doing something wrong or is this a bug?

[Updated on: Thu, 11 July 2013 08:48]

Report message to a moderator

Re: Setting certain cells in an editable table column to non-editable doesn't work [message #1070680 is a reply to message #1067916] Thu, 18 July 2013 12:54 Go to previous messageGo to next message
Andreas Hoegger is currently offline Andreas Hoegger
Messages: 174
Registered: February 2010
Senior Member
Do not use methods start with internal! Smile

To get there use on the method execIsEditable on any table column. With this way you are able to make a certain cell editable.

Hope that helps...
-andreas
Re: Setting certain cells in an editable table column to non-editable doesn't work [message #1072138 is a reply to message #1070680] Mon, 22 July 2013 06:43 Go to previous message
Urs Beeli is currently offline Urs Beeli
Messages: 330
Registered: October 2012
Location: Bern, Switzerland
Senior Member
Andreas

Thanks for the hint about execIsEditable(), it works like a charm. I don't know how I could have missed it...

I knew using internal methods (even those *ending* with internal Wink) probably wasn't a good idea, but I was grasping at straws.
Previous Topic:AbstractTool[Form]Button doesn't show
Next Topic:(Manually) handling the wait cursor
Goto Forum:
  


Current Time: Fri Sep 19 22:03:57 GMT 2014

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

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