Added event function to the formPanel using mvc concept.