Data binding with validation and empty WritableValue

87 views
Skip to first unread message

István

unread,
Jun 13, 2013, 3:41:48 AM6/13/13
to vog...@googlegroups.com
Hello all,

i have an SWT form with fields data-bound to the properties of a WritableValue object. The data binding configuration is done when the form is constructed, but initially the fields are disabled and the WritableValue contains null.

Later when the user selects an entity from some list, the corresponding model entity gets set to the WritableValue and the form fields are all get enabled.

The problem is that the validators involved in the data binding process are fired even when the WritableValue contains no model (just null), so when the form is initially disabled, i have fields marked as "invalid".

I would like to avoid validating fields when no model is assigned to the WritableValue. Furthermore, if one is done editing the model and set the WritableValue to null, the fields should be marked as "valid" and all set to disabled again.

How could it be done? Any pointers would be great!

Thanks.

Lars Vogel

unread,
Jun 17, 2013, 5:14:04 AM6/17/13
to vog...@googlegroups.com
I suggest to post this question to the JFace group in the Eclipse forum. See http://www.vogella.com/faq.html


2013/6/13 István <contact....@gmail.com>

--
You received this message because you are subscribed to the Google Groups "vogella" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vogella+u...@googlegroups.com.
To post to this group, send email to vog...@googlegroups.com.
Visit this group at http://groups.google.com/group/vogella.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

István

unread,
Jun 17, 2013, 7:47:23 AM6/17/13
to vog...@googlegroups.com
Okay, thanks for the tip.
Reply all
Reply to author
Forward
0 new messages