Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » [Databinding] Display error dialog when validation returned error status
[Databinding] Display error dialog when validation returned error status [message #335040] Wed, 18 March 2009 17:17 Go to next message
Sebastian Paul is currently offline Sebastian PaulFriend
Messages: 106
Registered: July 2009
Senior Member
Hi,
I have to display an error dialog when validation returned an error
status. Sure, this only makes sense for Text controls and the FocusOut
event. The text control should be focussed when the dialog is closed.
What is the recommended way to do that? I tried some different ways, but
they all seem ugly.

Kind regards, Sebastian
Re: [Databinding] Display error dialog when validation returned error status [message #335042 is a reply to message #335040] Wed, 18 March 2009 21:41 Go to previous messageGo to next message
Matthew Hall is currently offline Matthew HallFriend
Messages: 368
Registered: July 2009
Senior Member
Sebastian Paul wrote:
> Hi,
> I have to display an error dialog when validation returned an error
> status. Sure, this only makes sense for Text controls and the FocusOut
> event. The text control should be focussed when the dialog is closed.
> What is the recommended way to do that? I tried some different ways, but
> they all seem ugly.
>
> Kind regards, Sebastian

You should add a value change listener to the binding's
getValidationStatus() observable. When it changes value, show the
dialog if the current status is an error.

You could call text.setFocus() after the dialog closes in your value
change listener. Be careful with this though, it is possible to
accidentally trap the user in a field with no way to correct the problem.

Matthew
Re: [Databinding] Display error dialog when validation returned error status [message #335046 is a reply to message #335042] Thu, 19 March 2009 09:33 Go to previous messageGo to next message
Sebastian Paul is currently offline Sebastian PaulFriend
Messages: 106
Registered: July 2009
Senior Member
Hi,
I already tried this and it works, but it has a drawback: After the
dialog was shown and the Text focused again, the user can leave the Text
without any further error dialog. That's not surprising, as the
validation status did not change meanwhile. But in my case, the user
should be trapped until the input has the correct format.
I think this is no good UI, but I have to implement this due to project
requirements :(
Any idea? I thought of setting a stale flag manually, but it does not
seem to be possible.

Sebastian

Matthew Hall wrote:
> Sebastian Paul wrote:
>> Hi,
>> I have to display an error dialog when validation returned an error
>> status. Sure, this only makes sense for Text controls and the FocusOut
>> event. The text control should be focussed when the dialog is closed.
>> What is the recommended way to do that? I tried some different ways,
>> but they all seem ugly.
>>
>> Kind regards, Sebastian
>
> You should add a value change listener to the binding's
> getValidationStatus() observable. When it changes value, show the
> dialog if the current status is an error.
>
> You could call text.setFocus() after the dialog closes in your value
> change listener. Be careful with this though, it is possible to
> accidentally trap the user in a field with no way to correct the problem.
>
> Matthew
Re: [Databinding] Display error dialog when validation returned error status [message #335049 is a reply to message #335046] Thu, 19 March 2009 11:17 Go to previous messageGo to next message
Sebastian Paul is currently offline Sebastian PaulFriend
Messages: 106
Registered: July 2009
Senior Member
Sebastian Paul wrote:
> Hi,
> I already tried this and it works, but it has a drawback: After the
> dialog was shown and the Text focused again, the user can leave the Text
> without any further error dialog. That's not surprising, as the
> validation status did not change meanwhile. But in my case, the user
> should be trapped until the input has the correct format.
> I think this is no good UI, but I have to implement this due to project
> requirements :(
We are trying to convince our customer of changing the requirement and
add a control decoration instead. This will bypass the problem.

Regards, Sebastian
Re: [Databinding] Display error dialog when validation returned error status [message #335050 is a reply to message #335049] Thu, 19 March 2009 12:09 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Well this is good e.g. a user probably can't even quite the application
because you are showing the dialog.

Tiom

Sebastian Paul schrieb:
> Sebastian Paul wrote:
>> Hi,
>> I already tried this and it works, but it has a drawback: After the
>> dialog was shown and the Text focused again, the user can leave the
>> Text without any further error dialog. That's not surprising, as the
>> validation status did not change meanwhile. But in my case, the user
>> should be trapped until the input has the correct format.
>> I think this is no good UI, but I have to implement this due to
>> project requirements :(
> We are trying to convince our customer of changing the requirement and
> add a control decoration instead. This will bypass the problem.
>
> Regards, Sebastian
Re: [Databinding] Display error dialog when validation returned error status [message #335053 is a reply to message #335049] Thu, 19 March 2009 15:33 Go to previous message
Matthew Hall is currently offline Matthew HallFriend
Messages: 368
Registered: July 2009
Senior Member
We're planning support for automatic control decoration from a binding:

See https://bugs.eclipse.org/268472

Matthew


Sebastian Paul wrote:
> Sebastian Paul wrote:
>> Hi,
>> I already tried this and it works, but it has a drawback: After the
>> dialog was shown and the Text focused again, the user can leave the
>> Text without any further error dialog. That's not surprising, as the
>> validation status did not change meanwhile. But in my case, the user
>> should be trapped until the input has the correct format.
>> I think this is no good UI, but I have to implement this due to
>> project requirements :(
> We are trying to convince our customer of changing the requirement and
> add a control decoration instead. This will bypass the problem.
>
> Regards, Sebastian
Previous Topic:Shared target platform, debugging, and multiple dev platforms
Next Topic:Re: display branch name in package explorer
Goto Forum:
  


Current Time: Fri Dec 27 12:29:11 GMT 2024

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

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

Back to the top