use of com.servoy.j2db.server.ngclient.IDataAdapterList in project servoy-client by Servoy.
the class WebFormController method refreshAllPartRenderers.
@Override
protected void refreshAllPartRenderers(IRecordInternal[] records) {
if (!isFormVisible || application.isShutDown() || rendering)
return;
// don't do anything yet when there are records but the selection is invalid
if (formModel != null && (formModel.getSize() > 0 && (formModel.getSelectedIndex() < 0 || formModel.getSelectedIndex() >= formModel.getSize())))
return;
// let the ui know that it will be touched, so that locks can be taken if needed.
boolean executeOnRecordSelect = false;
IRecordInternal[] state = records;
if (state == null) {
if (formModel != null) {
state = new IRecordInternal[] { formModel.getPrototypeState() };
} else {
state = new IRecordInternal[] { new PrototypeState(null) };
}
}
if (!(records == null && formModel != null && formModel.getRawSize() > 0) && isStateChanged(state)) {
lastState = state;
executeOnRecordSelect = true;
}
IDataAdapterList dataAdapterList = getFormUI().getDataAdapterList();
for (IRecordInternal r : state) dataAdapterList.setRecord(r, true);
if (executeOnRecordSelect) {
// do this at the end because dataRenderer.refreshRecord(state) will update selection
// for related tabs - and we should execute js code after they have been updated
executeOnRecordSelect();
}
}
Aggregations