Skip to content
Gerard Llort edited this page Mar 13, 2017 · 13 revisions

In Cosmo, a View is an element that can be send to a client (browser) to represent anything representable with HTML. There are three types of views. A view is created using a combination of controls (implementations of Cosmo.UI.Controls.Control).

Currently there are three distinct types of views, each one created for specific representation of data:

Implementing a view

To create a view you need to implement one of the three types of views:

  • Cosmo.UI.PageView for a standard page
  • Cosmo.UI.ModalView for a modal views
  • Cosmo.UI.PartialView for a partial views included in a standard page

View life-cycle

To implement a view, you need to understand the view life-cycle. When a browser calls a view, the following calls will be performed:

InitPage

This is the first method called and usually the page construction is placed here.

FormDataReceived

If a request for the view is a postback from a form (FormControl), this method is called and via parameters the form with the data received is provided.

FormDataLoad

LoadPage

Clone this wiki locally