ensureSet();
Log.debug("Creating bindings for: " + widget);
final FieldGroup group = widget.getFieldGroup();
final List<Binding> bchildren = binding.getChildren();
Binding b;
for(final IFieldWidget<?> fw : group.getFieldWidgets(null)) {
// clear the current value to re-mark the field's initial value
fw.clearValue();
try {
Log.debug("Binding field: " + fw + " to model prop [" + fw.getPropertyName() + "]..");
b = createFieldBinding(fw);
bchildren.add(b);
}
catch(final BindingException e) {
Log.warn("Skipping field binding for property: " + fw.getPropertyName() + " due to " + e.getMessage());
}
}
// bind the indexed
final IIndexedFieldBoundWidget[] indexedWidgets = widget.getIndexedChildren();
if(indexedWidgets != null) {
for(final IIndexedFieldBoundWidget iw : indexedWidgets) {
Log.debug("Creating indexed bindings for: " + iw);
// add binding to the many value collection only
b =
new Binding(widget.getModel(), iw.getIndexedPropertyName(), null, null, null, iw,
IBindableWidget.PROPERTY_VALUE, null, null, null);
binding.getChildren().add(b);
}
}