Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » NatTable : Table level validations (continued)(Got a reply to my previous post, "Post Quick reply" not working, so new topic.)
NatTable : Table level validations (continued) [message #1282874] Wed, 02 April 2014 21:55 Go to next message
pawan kalyan kalyan is currently offline pawan kalyan kalyanFriend
Messages: 3
Registered: March 2014
Junior Member
Hi Dirk and John,
Using your above suggestions, I could implement what I needed to some extent. Thank you so much.

Dirk,
I have a question regarding the approach in your blog :-
Question : I implemented the code in the blog and I am able to highlight a COMBO box upon the button (which exists under a NatTable grid) click. I implemented the below code :-

ComboBoxPainter comboBoxPainter = new ComboBoxPainter(FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_ERROR).getImage());
configRegistry.registerConfigAttribute(
CellConfigAttributes.CELL_PAINTER,
comboBoxPainter,
DisplayMode.NORMAL,
VGIGridStyle.CELL_ERROR_LABEL_EDIT_GRID);

On doing this, I am able to display an image (I need to display an asterick in red color, for all COMBOs that have errors) in a COMBO box that has error. But, after the button click, a user has to deliberately click on the COMBO cell or somewhere on the grid to see this image in COMBO. It doesn't happen right after the button click. Also, upon doing this, the COMBO doesn't appear like a COMBO but like a text box (that is, no drop down exists). Only when the user clicks on the cell, he would realize that it's actually a COMBO.

So, here is what I need and am looking for your help :-

1. Display a COMBO, which looks like a COMBO (that is, which has a drop down clearly visible, indicating it's a COMBO) when the Grid loads the first time, without user having to click on any COMBO cell or anywhere on the grid.
2. When user clicks on the button under NatTable, display the image (in my case, asterick) in all the COMBOs which have validation errors, without user having to click on any COMBO cell or anywhere on the grid.
3. When the user does a mouse over on those asterick images, display a message something like "Enter data" for all the COMBOs with invalid data.

Please let me know if you have any questions. Any help will be greatly appreciated.

I am not allowed to attach any documents (for screen shots to help you understand better) from my official desktop.

Thanks,
Pawan Kalyan.
Re: NatTable : Table level validations (continued) [message #1283231 is a reply to message #1282874] Thu, 03 April 2014 07:21 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Quote:
1. Display a COMBO, which looks like a COMBO (that is, which has a drop down clearly visible, indicating it's a COMBO) when the Grid loads the first time, without user having to click on any COMBO cell or anywhere on the grid.


Use the ComboBoxPainter with its default icon. In the code you pasted, you replaced the icon that is shown for the combo box. If you need to decorate a default painter with another item, use a CellPainterDecorator

Quote:
2. When user clicks on the button under NatTable, display the image (in my case, asterick) in all the COMBOs which have validation errors, without user having to click on any COMBO cell or anywhere on the grid.


Than perform a refresh of the NatTable.

natTable.refresh();

or
natTable.doCommand(new VisualRefreshCommand());


Quote:
3. When the user does a mouse over on those asterick images, display a message something like "Enter data" for all the COMBOs with invalid data.


Hover support comes with NatTable 1.1. So far you will need to use a tooltip. Have a look at NatTableContentTooltip and create a custom one that shows your message in case of validation errors. But without further special modifications you wont be able to show the message only on hovering the decoration error icon.

P.S. I know there is not much documentation now and the Javadoc is also lacking in terms of completeness, but there is some documentation (e.g. http://eclipse.org/nattable/documentation.php?page=styling) and for the ComboboxPainter the Javadoc says about the icon parameter "@param comboImage The image marking the cell as a combo control"
Previous Topic:VerticalTextPainter update
Next Topic:Problem scrolling editable cell
Goto Forum:
  


Current Time: Thu Apr 25 10:42:54 GMT 2024

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

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

Back to the top