!OBiCMS Framework Widgets
  • Widget Basics
    • LoadWidget method
    • GenerateWidget method
    • Diagnostics
  • widgetSettings
  • ContextManager Class
  • PageSettings Class

Widget Basics

Widgets are the logic on your pages, each widget reloads in the background to hide the process from your users to keep there web requests as fast as possible. Each Widget has a load and a generate which control how the widget gets its data and how the Widget outputs the page.

LoadWidget Method
The LoadWidget method is fairly self explanetry. We use this method to collect all the data your Widget needs to generate its self when requested. The following is an example of how you can use the load to setup your Widget.
  • Create private variables in your class to store your data
  • Create new variables in side the LoadWidget method to use while the load in doing its stuff.
  • Once the load has finished filling up the variables declared inside the LoadWidget method, replace the variables you declared in the class with them

Using your widget in this way stops any possible problems that could accure if a user requests a list at the same time as the Widget reloads. If you used the same variables for both the generate and the load then the generate might attempt to use the variables the load just cleared so that it can refresh them with new data.

Last edited Jun 29, 2010 at 11:09 AM by Cadey, version 1


No comments yet.