GetDefaultView - cWebApp
Returns a handle to the application's default view
Type: Function
Return Data Type: Handle
Syntax
Function GetDefaultView Returns Handle
Call Example
Get GetDefaultView to HandleVariable
Description
This function returns the default view's object handle. By default, this is the same as the value stored in the phoDefaultView property.
You can augment this function to specify the default view dynamically based on various rules determined by your application.
The default view to be displayed when a web application is loaded is determined by setting the phoDefaultView property. phoDefaultView is a design time property. Once set it should not be changed. GetDefaultView is used to return the handle of the default view. By default, GetDefaultView returns the value of phoDefaultView. If you wish to dynamically change the default view you can do so by augmenting GetDefaultView. For example, you might wish to do this to display different default views for different users, or, to display different views for different clients.
All of the framework packages and templates retrieve the default view by calling GetDefaultView instead of using phoDefaultView. If you need to access this view, you should do the same.
Note
You may use this function in combination with GetLoginView to load a different dashboard per user (group) or rights. In this case, developers are responsible for adding ALL of the alternative login or default views to the navigation path system with WebRegisterPath.
The Framework itself checks for phoLoginView and phoDefaultView and registers these components with WebRegisterPath and will not know what other views can be returned by the functions GetDefaultView and GetLoginView. Note that setting phoDefaultView or phoLoginView is not needed when using GetDefaultView and GetLoginView.
GetLoginView needs to be aware that for a desktop style application, the login is handled by a cWebModalDialog and for a drill down application by a cWebView. Both login components (by default, LoginDialog.wo and Login.wo) have the pbLoginModeEnforced set to false, otherwise one cannot login at all.