Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Databinding Synchronization Doubt
Databinding Synchronization Doubt [message #333800] Tue, 06 January 2009 12:42 Go to next message
Marcelo Alcantara is currently offline Marcelo AlcantaraFriend
Messages: 48
Registered: July 2009
Member
Hi All,

When we use databinding and we have validation, there is a situation that
bothers me.

If we set a value to a text field with required validation, the value is
updated to the model pojo. Fine.

But if we change this value to nothing (selected and del) the validation
stops the updating process and the value is not updated to the model. But
the text field is cleared. At this point, on the model we have the previous
value and on the text field we have nothing.

How do you guys deal with this kind of situation?

I saw on the databinding code that you can change the severity of the status
from error to warning and it would enable the model update either with
existing warnings (it just don
Re: Databinding Synchronization Doubt [message #333807 is a reply to message #333800] Tue, 06 January 2009 21:02 Go to previous messageGo to next message
Matthew Hall is currently offline Matthew HallFriend
Messages: 368
Registered: July 2009
Senior Member
Marcelo,

Generally what you want to do is display the validation status somewhere
on the form so that users can correct errors. You should also ensure
that users cannot proceed until any errors have been corrected.

DataBinding directly supports these requirements for instances of
DialogPage (including WizardPage and PreferencePage) and TitleAreaDialog:

(inside WizardPage.createContents() or delegate method)

DataBindingContext dbc = new DataBindingContext();

// create bindings

// Bind wizard page completion and status message to the binding context
WizardPageSupport.create(this, dbc);

Hope this helps,

Matthew


Marcelo Alcantara wrote:
> Hi All,
>
> When we use databinding and we have validation, there is a situation that
> bothers me.
>
> If we set a value to a text field with required validation, the value is
> updated to the model pojo. Fine.
>
> But if we change this value to nothing (selected and del) the validation
> stops the updating process and the value is not updated to the model. But
> the text field is cleared. At this point, on the model we have the previous
> value and on the text field we have nothing.
>
> How do you guys deal with this kind of situation?
>
> I saw on the databinding code that you can change the severity of the status
> from error to warning and it would enable the model update either with
> existing warnings (it just don´t update with the error severity). This is
> the way to do it?
>
> There is a eclipse forms/validation guide somewhere that says how to deal
> with such situations?
>
> Thanks in advance,
>
> Regards,
>
> Marcelo
>
>
Re: Databinding Synchronization Doubt [message #333871 is a reply to message #333807] Sun, 11 January 2009 20:30 Go to previous message
Marcelo Alcantara is currently offline Marcelo AlcantaraFriend
Messages: 48
Registered: July 2009
Member
Matthew,

Thanks for your advice.

I am following it.

I will make another post right now about checkbox table set validation. It
would be great if you could give some advice on it.

Regards,

Marcelo

"Matthew Hall" <matthall@woodcraftmill.com> escreveu na mensagem
news:gk0gso$3ba$1@build.eclipse.org...
> Marcelo,
>
> Generally what you want to do is display the validation status somewhere
> on the form so that users can correct errors. You should also ensure that
> users cannot proceed until any errors have been corrected.
>
> DataBinding directly supports these requirements for instances of
> DialogPage (including WizardPage and PreferencePage) and TitleAreaDialog:
>
> (inside WizardPage.createContents() or delegate method)
>
> DataBindingContext dbc = new DataBindingContext();
>
> // create bindings
>
> // Bind wizard page completion and status message to the binding context
> WizardPageSupport.create(this, dbc);
>
> Hope this helps,
>
> Matthew
>
>
> Marcelo Alcantara wrote:
>> Hi All,
>>
>> When we use databinding and we have validation, there is a situation that
>> bothers me.
>>
>> If we set a value to a text field with required validation, the value is
>> updated to the model pojo. Fine.
>>
>> But if we change this value to nothing (selected and del) the validation
>> stops the updating process and the value is not updated to the model. But
>> the text field is cleared. At this point, on the model we have the
>> previous value and on the text field we have nothing.
>>
>> How do you guys deal with this kind of situation?
>>
>> I saw on the databinding code that you can change the severity of the
>> status from error to warning and it would enable the model update either
>> with existing warnings (it just don
Previous Topic:Eclipse hel webapp deployment with Apache HTTPD and Tomcat
Next Topic:is ganymedge stable for use?
Goto Forum:
  


Current Time: Fri Apr 26 17:53:09 GMT 2024

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

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

Back to the top