|How do I bind CCombo contents to a parent-child bean? [message #637545]
||Sat, 06 November 2010 13:03
| John Ormerod
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!
[Updated on: Sat, 06 November 2010 13:06]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01787 seconds