Hi Volen,
Are you sure your desired functionality can't be achieved using the standard 'listen to' functionality of a dataview?
If you add a dataview you can select 'listen to widget' as Type for Data Source, thus having it 'listen' to, for instance, a data grid (see below example image)
Could specializations be an option? See documentation here: https://docs.mendix.com/refguide/edit-button
Regards,
Ronald