I want to add a check to the click event of a button, when check failed, I want to cancel the super call, how to do it?
I have tried to use FormControlCancelableSuperEventArgs and FormControlCancelEventArgs in event handler of clicking event, but both of them return null.
Below is my test code.
[FormControlEventHandler(formControlStr(LedgerJournalTable, Approve), FormControlEventType::Clicking)] public static void Approve_OnClicking(FormControl sender, FormControlEventArgs e) { FormControlCancelEventArgs ce = e as FormControlCancelEventArgs; // ce returns null FormControlCancelableSuperEventArgs ce = e as FormControlCancelableSuperEventArgs; // ce returns null too }
I know I can complete it by throw exception, but I think it is not a official way.
So how can I cancel the super call by a official way?