Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » databinding with multiple observables
databinding with multiple observables [message #733986] Thu, 06 October 2011 08:25 Go to next message
Jesper Eskilson is currently offline Jesper EskilsonFriend
Messages: 134
Registered: July 2009
Senior Member
Hello,

I have a general question of approach. I have a dialog where some
buttons enabled-state depends on several fields in the model object. How
is the typical way of handling this? From the documentation I've read,
databinding is always about connecting *two* observables.

In this concrete case I'm using SWT with databindings to a EMF model
object, and one of the buttons should be enabled if at least one of two
checkboxes as checked/selected.

One solution I can think of (for this case) is to introduce a separate
model field containing the enabled-state of the button and then use
regular EMF notifications to update that field when either one of the
checkboxes changes state.

--
/Jesper
Re: databinding with multiple observables [message #733988 is a reply to message #733986] Thu, 06 October 2011 08:34 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

You could create a ComputedValue which itself connects to the domain
model attributes. The computed value is then bound to the
Buttons-Enabled-Property.

Tom

Am 06.10.11 10:25, schrieb Jesper Eskilson:
> Hello,
>
> I have a general question of approach. I have a dialog where some
> buttons enabled-state depends on several fields in the model object. How
> is the typical way of handling this? From the documentation I've read,
> databinding is always about connecting *two* observables.
>
> In this concrete case I'm using SWT with databindings to a EMF model
> object, and one of the buttons should be enabled if at least one of two
> checkboxes as checked/selected.
>
> One solution I can think of (for this case) is to introduce a separate
> model field containing the enabled-state of the button and then use
> regular EMF notifications to update that field when either one of the
> checkboxes changes state.
>
> --
> /Jesper
Re: databinding with multiple observables [message #736243 is a reply to message #733988] Thu, 13 October 2011 20:26 Go to previous message
Jesper Eskilson is currently offline Jesper EskilsonFriend
Messages: 134
Registered: July 2009
Senior Member
Tom Schindl skrev 2011-10-06 10:34:
> Hi,
>
> You could create a ComputedValue which itself connects to the domain
> model attributes. The computed value is then bound to the
> Buttons-Enabled-Property.

Ok, thanks.
Previous Topic:Border around Treeviewer rows/nodes?
Next Topic:[Forms] ColumnLayout
Goto Forum:
  


Current Time: Thu Apr 25 02:00:32 GMT 2024

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

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

Back to the top