using repeat templates
Added data binding for fields and eventhandler.