Binding to an object instance rather than to one of its properties [message #1220447] |
Wed, 11 December 2013 14:26  |
Eclipse User |
|
|
|
My EMF domain looks something like this:
Bookstore {
Book[] books
...
}
How do I bind an instance of Bookstore, which is my top level object to the input of a JFace viewer?
i.e.,
<ListViewer input="{Binding Path=this}">
Rather than
// this works
<ListViewer input="{Binding Path=books}">
Thanks,
-S.
|
|
|
|
Re: Binding to an object instance rather than to one of its properties [message #1220451 is a reply to message #1220449] |
Wed, 11 December 2013 14:42  |
Eclipse User |
|
|
|
BTW. that works because XWT can automatically detect what Databinding to use (POJO/Bean/EMF) and you can mix them.
Erdal Karaca wrote on Wed, 11 December 2013 20:39You would have to introduce a wrapper (domain) class and use an instance of that as your data context. You can either model this explicitly (if your Bookstore has no container) or create a simple POJO/Bean:
class BookstoreWrapper {
Bookstore bookstore;
...
}
Keep in mind that a ListViewer is suited to showing one of many options in a list.
I assume you have multiple Bookstores that have to be shown in the ListViewer?
Sharon Dagan wrote on Wed, 11 December 2013 20:26My EMF domain looks something like this:
Bookstore {
Book[] books
...
}
How do I bind an instance of Bookstore, which is my top level object to the input of a JFace viewer?
i.e.,
<ListViewer input="{Binding Path=this}">
Rather than
// this works
<ListViewer input="{Binding Path=books}">
Thanks,
-S.
|
|
|
Powered by
FUDForum. Page generated in 0.08169 seconds