Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » How do I bind CCombo contents to a parent-child bean?(observeList() does not seem to resolve a compound property name like parent.child)
How do I bind CCombo contents to a parent-child bean? [message #637545] Sat, 06 November 2010 13:03
John Ormerod is currently offline John OrmerodFriend
Messages: 39
Registered: January 2010
jFace databinding must be one of Eclipse's best kept secrets!

I have successfully used it to bind to single values in beans that contain child beans, using the propertyName format: xxxx.yyyy.

I've now got to the point of Combos and wanting to populate from a List in a child bean. However, when I code:
BeansObservables.observeList(parentDO, "parent.child", String.class)
the framework reports that it can't find 'parent.child' in parentDO.

Yet, when I have used BeansObservables.observeValue(parentDO, "parent.child") for Text parts, it resolves perfectly by using the getChildDO() method in the parentDO.

Is this a bug for lists?

I have tried hard-coding the getChildDO of the paretnDO and using its result along with "child" in the observeList() method and it works fine.

The reason I can't actually hard code this, is that I'm using databinding as part of an investigation into creating 'detail' GUIs using an externally-defined layout topology in XML (plugin.xml initially). So my code doesn't know the specifics of what it is actually dealing with. In fact, finding databinding solved the worry in the back of my mind as to how best to link to the model... until I got to Combos!

Regards, John

[Updated on: Sat, 06 November 2010 13:06]

Report message to a moderator

Previous Topic:How to update TreeViewer?
Next Topic:how to change and add TableViewer's columns dynamically
Goto Forum:

Current Time: Thu Jun 21 20:01:26 GMT 2018

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

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

Back to the top