Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » customize DialogErrorHandling class(own dialog error handling behavior needed)
customize DialogErrorHandling class [message #995262] Sat, 29 December 2012 15:19 Go to next message
Sascha Smoo is currently offline Sascha SmooFriend
Messages: 56
Registered: November 2012
Member
Hello,

I've got a problem using the new error handling in nattable. The default behavior using the DialogErrorHandling is to discard or change a value after validation. But what I need to do is validate the value and then keep or discard it. If the user decides to keep the value, it should be set by the PropertyAccessor class. I've created my own custom DialogErrorHandling class to change the dialog presented to the user and handle the "keep" button pressed behavior. Now to the problem, if the user clicks on "keep" I want to commit the value entered in the cell editor, but if I do so the validator will be fired again and I get the same dialog over and over again. Any suggestions on this?

greetings,
sascha
Re: customize DialogErrorHandling class [message #996568 is a reply to message #995262] Wed, 02 January 2013 11:53 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Hi Sascha,

well the issue on this is that you call commit for keeping the value. And the commit process simplified is always convert -> validate -> update
There is currently no way to skip the validation sometimes. So the only way is

a) implement the commit behaviour yourself without the validation part. So do the conversion and then call the UpdateDataCommand and then close the open editor.
b) open such a dialog in the PropertyAccessor yourself if it should be more a warning instead of real validation. Remember that validation normally is used to avoid wrong data in your data model.

What is the exact use case for commiting invalid data to the model? Maybe we need to extend the mechanisms in some way.

Greez,
Dirk

Re: customize DialogErrorHandling class [message #996575 is a reply to message #996568] Wed, 02 January 2013 12:18 Go to previous messageGo to next message
Sascha Smoo is currently offline Sascha SmooFriend
Messages: 56
Registered: November 2012
Member
Hey Dirk,

I already did implement your option A yesterday. Don't like it that way but I see no other solution. But let me explain my usecase to you.

Example:
- 3 Cells (January, Februray, March)
- 1 Cell (Quarter1)

The user is able to enter values for every month in the quarter and the quarter value will be summed up. But the user should also be able to enter the quarter value by himself. Doing so a warning dialog will show up and inform the user about the already existing month values. The user should decide now rather to override the quarter/month values. That means if you try to enter a value for a month or quarter but a 'contra' value already exists the popup dialog shows up and asks to set or discard the entered value.

Greetings,
Sascha
Re: customize DialogErrorHandling class [message #997310 is a reply to message #996575] Sat, 05 January 2013 15:01 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
I will create some enhancement bug to add support for such behaviour when I'm back. There are surely some more use cases that would need that.
Re: customize DialogErrorHandling class [message #1001698 is a reply to message #997310] Thu, 17 January 2013 08:30 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Created a bug for this https://bugs.eclipse.org/bugs/show_bug.cgi?id=398357
Re: customize DialogErrorHandling class [message #1005841 is a reply to message #1001698] Mon, 28 January 2013 23:24 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Committed a fix for this with the major edit refactoring.
Previous Topic:How to bind single and double clicks on one cell
Next Topic:Editing columns within row header
Goto Forum:
  


Current Time: Fri Apr 26 07:10:04 GMT 2024

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

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

Back to the top