Skip to main content



      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 13:17 Go to next message
Eclipse UserFriend
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 17:41 Go to previous messageGo to next message
Eclipse UserFriend
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 05:33 Go to previous messageGo to next message
Eclipse UserFriend
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 07:17 Go to previous messageGo to next message
Eclipse UserFriend
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 08:09 Go to previous messageGo to next message
Eclipse UserFriend
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 11:33 Go to previous message
Eclipse UserFriend
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: Tue Mar 11 23:53:26 EDT 2025

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

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

Back to the top