Skip to main content



      Home
Home » Eclipse Projects » NatTable » need checkbox only when editable(need checkbox only when editable)
need checkbox only when editable [message #1095692] Tue, 27 August 2013 07:54 Go to next message
Eclipse UserFriend
Hello all,

I am new to NatTable. I have gone thorough the NatTable examples and its source code but am not getting a solution to one of my problems.
In the NatTable I have a column that should provide a checkbox for selection depending on the value of another column.
I have used Checkboxpainter, checkboxcelleditor, the defaultbooleanconverter and IEditableRule. This renders a checkbox irrespective of whether the cell is editable or not though it allows me to mark the checkbox only if it is editable.

However as per our requirement user should not see the checkbox if the row is not selectable. or in worst case a disabledcheckbox should be rendered for rows that are not selectable.

Can someone please help me out?

Thanks and regards,
Pradyumna
Re: need checkbox only when editable [message #1095801 is a reply to message #1095692] Tue, 27 August 2013 10:51 Go to previous messageGo to next message
Eclipse UserFriend
You need to add a special label to that cells that show the checkbox and are disabled. Then you are able to register another painter in case the checkbox is not editable.
Re: need checkbox only when editable [message #1096313 is a reply to message #1095801] Wed, 28 August 2013 04:12 Go to previous messageGo to next message
Eclipse UserFriend
Thanks for your reply Dirk.
I got the solution which is probably a bit different from what you suggest.
I wrote a custom ChecBoxPainter in which i return a null from the getImage method for appropriate cells.
Re: need checkbox only when editable [message #1096317 is a reply to message #1096313] Wed, 28 August 2013 04:17 Go to previous messageGo to next message
Eclipse UserFriend
I still choose configuration over implementation as this is what NatTable supports. But feel free to use your workaround.
Re: need checkbox only when editable [message #1096975 is a reply to message #1096317] Thu, 29 August 2013 00:44 Go to previous messageGo to next message
Eclipse UserFriend
Can you tell me how to apply labels to individual cells based on a condition? Also is there a way to show/hide rows with such labeled cells based on an external checkbox?

Thanks in advance
Re: need checkbox only when editable [message #1097031 is a reply to message #1096975] Thu, 29 August 2013 02:42 Go to previous messageGo to next message
Eclipse UserFriend
http://www.eclipse.org/nattable/documentation.php?page=styling

The chapter on conditional styling should give the necessary information on the labels.

Row hide/show is not implemented via labels. You need to use the RowHideShowLayer and the corresponding commands to implement that.
Re: need checkbox only when editable [message #1097882 is a reply to message #1097031] Fri, 30 August 2013 05:27 Go to previous messageGo to next message
Eclipse UserFriend
Thanks Dirk.
I resolved show/hide of rows using filterator and a hidden textbox.
Using RowHideShowLayer I would have had to loop through rows searching for particular value in a column and then show/hide the row.
Am I right?

[Updated on: Fri, 30 August 2013 05:27] by Moderator

Re: need checkbox only when editable [message #1098138 is a reply to message #1097882] Fri, 30 August 2013 13:22 Go to previous message
Eclipse UserFriend
If you want to hide rows that contain special values, yes
Previous Topic:Making cell editable on user inputs.
Next Topic:BlinkLayer with GroupByDataLayer
Goto Forum:
  


Current Time: Wed Jul 16 13:53:52 EDT 2025

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

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

Back to the top