how to initialize the view field