Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Binding Multiple EObjects to Text Control
Binding Multiple EObjects to Text Control [message #424789] Wed, 05 November 2008 13:32 Go to next message
Maurice O'Connor is currently offline Maurice O'ConnorFriend
Messages: 86
Registered: July 2009
Member
Hey there,

I have a list of EObjects of type Person. At the moment each Person's Name
is bound to a Text Control when the user needs to edit it.

Can I get the Text Control to affect multiple Person EObjects using Data
Binding, so that changes to the Text Control affect the Name in each bound
Person EObject?

I'm not really sure I want to implement this, but it'd be nice to know if
it's possible...

Thanks!

Maurice
Re: Binding Multiple EObjects to Text Control [message #424790 is a reply to message #424789] Wed, 05 November 2008 14:00 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33216
Registered: July 2009
Senior Member
Maurice,

There's nothing built-in that would directly do this. You'd need to
devise some type of separator so you can parse the names into a list of
names and then match them to a corresponding list of objects. It sounds
tricky but as with most things, where there's a will there's a way.


Maurice O'Connor wrote:
> Hey there,
>
> I have a list of EObjects of type Person. At the moment each Person's
> Name is bound to a Text Control when the user needs to edit it.
>
> Can I get the Text Control to affect multiple Person EObjects using
> Data Binding, so that changes to the Text Control affect the Name in
> each bound Person EObject?
>
> I'm not really sure I want to implement this, but it'd be nice to know
> if it's possible...
> Thanks!
>
> Maurice
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Binding Multiple EObjects to Text Control [message #424794 is a reply to message #424789] Wed, 05 November 2008 14:30 Go to previous messageGo to next message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3070
Registered: July 2009
Senior Member
On 11/5/2008 8:32 AM, Maurice O'Connor wrote:
> Hey there,
>
> I have a list of EObjects of type Person. At the moment each Person's
> Name is bound to a Text Control when the user needs to edit it.
>
> Can I get the Text Control to affect multiple Person EObjects using Data
> Binding, so that changes to the Text Control affect the Name in each
> bound Person EObject?
>
> I'm not really sure I want to implement this, but it'd be nice to know
> if it's possible...

If you are using the Data Binding framework and are talking about the
value of the text field being assigned as the name for all Person
objects, there is nothing particularly tricky about doing it. You'd just
need one target observable on the Text and a bunch of model observables
on the Person objects; each model observable will be bound to the same
Text observable (and I would make the model-to-target update policy as
NEVER).
Data Binding should handle that just fine, although I've never actually
done it. If you have further problems with this approach, I'd suggest
posting to eclipse.platform where data binding questions belong (since
this is not really specific to EMF).

Hope this helps,
Eric
Re: Binding Multiple EObjects to Text Control [message #424798 is a reply to message #424794] Wed, 05 November 2008 17:38 Go to previous message
Maurice O'Connor is currently offline Maurice O'ConnorFriend
Messages: 86
Registered: July 2009
Member
Eric Rizzo wrote:

> If you are using the Data Binding framework and are talking about the
> value of the text field being assigned as the name for all Person
> objects, there is nothing particularly tricky about doing it. You'd just
> need one target observable on the Text and a bunch of model observables
> on the Person objects; each model observable will be bound to the same
> Text observable (and I would make the model-to-target update policy as
> NEVER).
> Data Binding should handle that just fine, although I've never actually
> done it. If you have further problems with this approach, I'd suggest
> posting to eclipse.platform where data binding questions belong (since
> this is not really specific to EMF).

Thanks Eric and Ed, this looks like it should work.

Maurice
Previous Topic:Best examples for creating EMF Resource implementations
Next Topic:[EMF] FeatureMap
Goto Forum:
  


Current Time: Sat Sep 21 02:47:55 GMT 2024

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

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

Back to the top