Loading UI from a database schema

Hi guys

My applcation involves a lot of forms and I have the forms declared as templates in mongo db. So for different situations, I would be pulling out diffferent form templates. These templates would be having all information like id name, action to be performed, positioning, section name grouping name, field values etcLet’s say I want to bring out a Login form and I have a login template with all the necessary details to show the form, how do I translate it to Vaadin UI page. How do I assign actions to different elements like button click etc, even though I have declared it in the declarative schema.

Regards
Kartik