| [DataBinding] Binding to multiple objects [message #335277] | 
Mon, 30 March 2009 10:42   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Hi, 
I'm using JFace databinding in my app and it's working great!  Need some  
help with a more advanced binding case though.. 
 
I have a kind of master-detail UI pattern, and eventually I need to  
support multiple selections.  When multiple "master" objects are selected,  
the "details" widgets need to show a single value if all the objects have  
the same value for a given property, "<multiple values>" if the objects  
have different values, and if I edit the value in given widget, it should  
apply to all objects. 
 
A good example is the behavior of fields for "Artist", "Album", etc. in a  
typical ID3 tag editor when selecting multiple songs. 
 
I can probably create a custom IObservable to implement this, or a wrapper  
at the domain object level (less desirable), but since it seems like a  
common UI pattern... does such a thing already exist in the framework, or  
there is a good example somewhere of a "single widget -> multiple objects"  
scenario like this? 
 
Thanks! 
Casey
 |  
 |  
  | 
| Re: [DataBinding] Binding to multiple objects [message #335278 is a reply to message #335277] | 
Mon, 30 March 2009 11:08    | 
 
Eclipse User  | 
 | 
 | 
   | 
 
We just barely added support for this in 3.5M6. 
 
 http://fire-change-event.blogspot.com/2009/02/master-detail- editing-with-multiple.html 
 
Matthew 
 
Casey Marshall wrote: 
> Hi, 
> I'm using JFace databinding in my app and it's working great!  Need some  
> help with a more advanced binding case though.. 
>  
> I have a kind of master-detail UI pattern, and eventually I need to  
> support multiple selections.  When multiple "master" objects are  
> selected, the "details" widgets need to show a single value if all the  
> objects have the same value for a given property, "<multiple values>" if  
> the objects have different values, and if I edit the value in given  
> widget, it should apply to all objects. 
>  
> A good example is the behavior of fields for "Artist", "Album", etc. in  
> a typical ID3 tag editor when selecting multiple songs. 
>  
> I can probably create a custom IObservable to implement this, or a  
> wrapper at the domain object level (less desirable), but since it seems  
> like a common UI pattern... does such a thing already exist in the  
> framework, or there is a good example somewhere of a "single widget ->  
> multiple objects" scenario like this? 
>  
> Thanks! 
> Casey 
>
 |  
 |  
  | 
| Re: [DataBinding] Binding to multiple objects [message #335282 is a reply to message #335277] | 
Mon, 30 March 2009 11:48   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Originally posted by: eclipse-news.rizzoweb.com 
 
On 3/30/2009 10:42 AM, Casey Marshall wrote: 
> Hi, 
> I'm using JFace databinding in my app and it's working great! Need some 
> help with a more advanced binding case though.. 
> 
> I have a kind of master-detail UI pattern, and eventually I need to 
> support multiple selections. When multiple "master" objects are 
> selected, the "details" widgets need to show a single value if all the 
> objects have the same value for a given property, "<multiple values>" if 
> the objects have different values, and if I edit the value in given 
> widget, it should apply to all objects. 
> 
> A good example is the behavior of fields for "Artist", "Album", etc. in 
> a typical ID3 tag editor when selecting multiple songs. 
> 
> I can probably create a custom IObservable to implement this, or a 
> wrapper at the domain object level (less desirable), but since it seems 
> like a common UI pattern... does such a thing already exist in the 
> framework, or there is a good example somewhere of a "single widget -> 
> multiple objects" scenario like this? 
 
I guess you'll have to use a ComputedValue to do this. But I haven't  
looked closely at the new capabilities coming for Data binding in  
Eclipse 3.5, so maybe there is some more advanced support... 
 
Eric
 |  
 |  
  | 
Powered by 
FUDForum. Page generated in 0.03795 seconds