@@ -1002,10 +1002,14 @@ public void process(IFormSubmitter submittingComponent)
1002
1002
1003
1003
// before updating, call the interception method for clients
1004
1004
beforeUpdateFormComponentModels ();
1005
+ internalOnBeforeUpdateFormComponentModels ();
1005
1006
1006
1007
// Update model using form data
1007
1008
updateFormComponentModels ();
1008
1009
1010
+ // after updating, call the interception method for clients
1011
+ internalOnAfterUpdateFormComponentModels ();
1012
+
1009
1013
// validate model objects after input values have been bound
1010
1014
internalOnValidateModelObjects ();
1011
1015
if (hasError ())
@@ -1288,15 +1292,66 @@ protected void addDefaultSubmitButtonHandler(IHeaderResponse headerResponse)
1288
1292
headerResponse .render (OnEventHeaderItem .forMarkupId (getMarkupId (), "keypress" , script .toString ()));
1289
1293
}
1290
1294
1295
+
1291
1296
/**
1292
1297
* Template method to allow clients to do any processing (like recording the current model so
1293
1298
* that, in case onSubmit does further validation, the model can be rolled back) before the
1294
1299
* actual updating of form component models is done.
1295
- */
1300
+ *
1301
+ * @deprecated Use {@linkplain #onBeforeUpdateFormComponentModels} instead.
1302
+ */
1303
+ @ Deprecated (since = "10.5.0" , forRemoval = true )
1296
1304
protected void beforeUpdateFormComponentModels ()
1297
1305
{
1298
1306
}
1299
1307
1308
+
1309
+ /**
1310
+ * Calls {@linkplain #onBeforeUpdateFormComponentModels()} on this form and all nested forms that are
1311
+ * visible and enabled.
1312
+ */
1313
+ private void internalOnBeforeUpdateFormComponentModels ()
1314
+ {
1315
+ visitFormsPostOrder (this , (form , visit ) -> {
1316
+ if (form .isVisibleInHierarchy () && form .isEnabledInHierarchy ())
1317
+ {
1318
+ form .onBeforeUpdateFormComponentModels ();
1319
+ }
1320
+ });
1321
+ }
1322
+
1323
+ /**
1324
+ * Hook method to allow clients to do any processing (like recording the current model so
1325
+ * that, in case onSubmit does further validation, the model can be rolled back) before the
1326
+ * actual updating of form component models is done.
1327
+ */
1328
+ protected void onBeforeUpdateFormComponentModels ()
1329
+ {
1330
+ }
1331
+
1332
+ /**
1333
+ * Calls {@linkplain #onAfterUpdateFormComponentModels()} on this form and all nested forms that are
1334
+ * visible and enabled.
1335
+ */
1336
+ private void internalOnAfterUpdateFormComponentModels ()
1337
+ {
1338
+ visitFormsPostOrder (this , (form , visit ) -> {
1339
+ if (form .isVisibleInHierarchy () && form .isEnabledInHierarchy ())
1340
+ {
1341
+ form .onAfterUpdateFormComponentModels ();
1342
+ }
1343
+ });
1344
+ }
1345
+
1346
+ /**
1347
+ * Hook method to allow clients to do any processing (like updating entities or DTO from the models
1348
+ * to be used later on the next late-stage validation) after the actual updating of form component
1349
+ * models is done.
1350
+ */
1351
+ protected void onAfterUpdateFormComponentModels ()
1352
+ {
1353
+ }
1354
+
1300
1355
/**
1301
1356
* Called (by the default implementation of 'process') when all fields validated, the form was
1302
1357
* updated and it's data was allowed to be persisted. It is meant for delegating further
0 commit comments