Hi everyone,
I’m new to A12
I have a general question I cannot find the answer in documentation
I have created a button using SME and assigned an event to this button
now the question is how I can catch this event in client side?
redacted redacted redacted
As @alicia-secure-haze mentioned you can handle it through a Saga,
e.g when you want to catch an event from the Form Engine you can do something like this:
export function* watchFormEngineEvent(): SagaIterator{
// your handleEvent saga called every time your action is dispatched
yield takeLatest(
(action: AnyAction) => FormEngineActions.event.match(action), handleEvent)
//you can define your action instead of using action:AnyAction
);
}
function* handleEvent(action: Action<FormEngineActions.FormEngineEventActions>): SagaIterator {
// do something
}
You can catch Overview Events within your customized Overview component through EventHandlers interface by using onRowButtonClick.
const eventHandlers: OverviewEngineApi.EventHandlers = {
onRowButtonClick({ documentId, rowActionModel }) {
//here you catch the Overview event you want to catch
if(rowActionModel.event==="any_event"){
//do something
}
}
}