Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Validating input in a TableViewer
Validating input in a TableViewer [message #444948] Sat, 25 February 2006 04:52
Antonio Gurisatti is currently offline Antonio GurisattiFriend
Messages: 109
Registered: July 2009
Senior Member
I have a column with a TextCellEditor attached to a column and need to validate users input.

If I use the method found on more than one example, i.e

((Text) lengthEditor.getControl()).addVerifyListener(
new VerifyListener() {
public void verifyText(VerifyEvent e) {
// Here, we could use a RegExp such as the following
// if using JRE1.4 such as e.doit = e.text.matches("[\\-0-9]*");
e.doit = "0123456789".indexOf(e.text) >= 0 ;
}
});

then the label provider get nuts giving wrong values when I click en the same column of a different row.

If I use an ICellEditorValidator (that works perfectly for Properties) I get a message saying "There was an error, for more details look at the error log". I couldn't find an entry in the error log.

So, the workaround I found was to do the required validation in the "CellModifierClass", changing the value only if it is correct. This way, if the input is wrong, it leaves the old value. The only issue is that it doesn't blocks navigation.

Even thought I found this workaround I'm not really satisfied:

I'd like to know if there is a big bug around this or if I am missing something.

Thanks a heap
Previous Topic:SaxParser does not find a referenced DTD in Plugin
Next Topic:Preload jar on Application-Start
Goto Forum:
  


Current Time: Mon Nov 11 21:40:46 GMT 2024

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

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

Back to the top