Binding sub-properties to child components
I'm writing a compound component based on UIPanel.
My component is passed a domain object with a number of properties, using a valuebinding.
In my component I create a number of child components using the standard ones, eg. HtmlInputText or checkbox, etc.
I want to bind these child components to properties of the domain object.
I've been trying to do this with the following code, which I include really only to illustrate what I'm trying to do. I don't think this is the way to do it because I really don't like hacking the expression.
ValueBinding vb=getValueBinding("element");
String s=vb.getExpressionString();
s=s.replace("}",".textValue}");
ValueBinding propVb=app.createValueBinding(s);
HtmlInputText hit=(HtmlInputText) app.createComponent(HtmlInputText.COMPONENT_TYPE);
hit.setValueBinding("value", propVb);
getChildren().add(hit);
To summarise, I want to build a component that can handle the editing UI for a domain object, with multiple child components in my custom component.
It's important that this is a custom component because I'm actually adding them to the view as a result of iterating a polymorphic list, with a different component for each object type in the list.
Hope this is clear and any help appreciated.
Alfie.

