Added initWidget() in NewResourceDialog, although it is not complete.

It has some behaviour code in the widget.
TODO: move those to the controller.