Skip to content

Commit 77dd82a

Browse files
rismehtaci-build
authored andcommitted
using custom event
1 parent 19199b9 commit 77dd82a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ui.frontend/src/utils.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import {Constants} from "./constants.js";
1818
import HTTPAPILayer from "./HTTPAPILayer.js";
1919
import {customFunctions} from "./customFunctions.js";
20-
import {FunctionRuntime, FormRendered} from '@aemforms/af-core';
20+
import {FunctionRuntime, CustomEvent} from '@aemforms/af-core';
2121
import {loadXfa} from "./handleXfa";
2222
import RuleUtils from "./RuleUtils.js";
2323

@@ -355,12 +355,12 @@ class Utils {
355355
Utils.initializeAllFields(formContainer);
356356
const event = new CustomEvent(Constants.FORM_CONTAINER_INITIALISED, { "detail": formContainer });
357357
document.dispatchEvent(event);
358-
// Dispatch formRendered event after form is fully rendered
358+
// Dispatch custom:formViewInitialized event after form is fully rendered
359359
if (formContainer && formContainer._model) {
360360
try {
361-
formContainer._model.dispatch(new FormRendered());
361+
formContainer._model.dispatch(new CustomEvent('formViewInitialized', {}, true));
362362
} catch (error) {
363-
console.warn('Failed to dispatch formRendered event:', error);
363+
console.warn('Failed to dispatch custom:formViewInitialized event:', error);
364364
}
365365
}
366366
}

0 commit comments

Comments
 (0)