Fixed apply template function and openSubModal function in BaseView