}
}
//fire onValidate for target component
Events.sendEvent(new Event("onBindingValidate", target));
//saveAttribute for each binding
Component loadOnSaveProxy = null;
Component dataTarget = null;
DataBinder binder = null;
final List loadOnSaveInfos = new ArrayList(tmplist.size());
for(final Iterator it = tmplist.iterator();it.hasNext();) {
final BindingInfo bi = (BindingInfo) it.next();
dataTarget = bi.getComponent();
final Binding binding = bi.getBinding();
if (binder == null) {
binder = binding.getBinder();
}
final Object[] vals = bi.getAttributeValues();
binding.saveAttributeValue(dataTarget, vals, loadOnSaveInfos, triggerEventName);
if (loadOnSaveProxy == null && dataTarget.isListenerAvailable("onLoadOnSave", true)) {
loadOnSaveProxy = dataTarget;
}
}
//bug #1895856 : data binding LoadOnSave works only on the last save-when component
//do loadOnSave
//if (dataTarget != null) {
// Events.postEvent(new Event("onLoadOnSave", dataTarget, loadOnSaveInfos));
// }
// (use first working dataTarget as proxy)
//feature#2990932, allow disable load-on-save mechanism
if (loadOnSaveProxy != null && binder.isLoadOnSave()) {
Events.postEvent(new Event("onLoadOnSave", loadOnSaveProxy, loadOnSaveInfos));
}
}