revert ea15dd8 and add method to attach js event after submitting the form

fixes #300
fix js bug with sonata_type_model add button

fixes #300