link source : www.pradoframework.com
This is really a question of "What properties (including value) should controls have?" relative to a page's lifecycle. PRADO loads control properties in five stages, each overriding the last:
1. Template data.
2. Data set in onInit: This is where you should initialize components. Part of initialization is databinding. For example, on a page containing a listbox of countries, you would want fill it with countries at this stage. TListControl (and all its descendants TDropDownList, TCheckBoxList, etc), TDataGrid, TDataList, and TRepeater should be initialized here.
3. ViewState data.
4. POST data. If your controls haven't been initialized by this point, strange behavior may result.
5. Data set in onLoad: If you want to override the POST values, you must do this here.
If no data affecting controls load in the ViewState and POST stages, onInit and onLoad are functionally equivalent.
What is the difference between TPage->onInit() and TPage->onLoad()?
Posted by NanoTutor | Wednesday, February 18, 2009 | Prado | 0 comments »
Subscribe to:
Post Comments (Atom)
0 comments
Post a Comment