PDA

View Full Version : Developing WebViewWidgets in Lianja



barrymavin
2012-10-29, 00:54
The architecture we use for WebViewWidgets is designed around an MVC (Model View Controller) pattern.

The way we accomplish this is using a "Page Controller" and a "View". See this article on MSDN (http://msdn.microsoft.com/en-us/library/ff649595.aspx) for an explanation of what a "Page Controller" is.

After reading that article you will better understand why when writing a WebViewWidget e.g. the Calendar WebViewWidget, we split the code up
into calendar_view.rsp and calendar_controller.prg.

The "Model" is the actual data that is Created, Read, Updated or deleted (CRUD) which in most cases (but not all) will be data in a database.

The "View" is the HTML5 (with optional embedded JavaScript data) displayed in the WebView section.

The "Controller" handles "actions" as requested by the "View" which may result in a new view being rendered in the WebView section replacing the one which made the action request.

Hence WebViewWidgets are developed around an MVC pattern.