The base "view" class. Views are the components that make up a WFPage. Each page has a root view, and then is made up of various subviews in a view hierarchy. There is also a well-defined class hierarchy for WFView that contains all components that are used in creating a web page.
WFView - Views are just generalized components for displaying on screen. NSView is abstract.
|
`-WFTabView - A tabbed view containing other pages. (NOT YET IMPLEMENTED)
`-WFBoxView - A simple box containing content from another page. (NOT YET IMPLEMENTED)
|
`-WFWidget - A specialized view for dealing with displaying editale values or actionable controls.
| Also abstract. Adds data get/set methods.
| Add support for editable, error tracking, and formatters.
`-WFForm - A Form object.
`-WFTextField - A textfield item.
`-WFCheckbox - A checkbox item.
`-WFLabel - For displaying uneditable text, but can use bindings and formatters.
(etc)Since we're a web framework, all views eventually know how to render themselves into HTML.
Views have no maintained state. Anything that needs to maintain state should be a WFWidget subclass.
WFView contains the basic infrastructure support the YUI library, which is PHOCOA's Javascript and AJAX layer.
Located in /framework/widgets/WFView.php (line 35)
WFObject | --WFView
| Class | Description |
|---|---|
| WFPaginatorPageInfo | A Paginator Page info widget. |
| WFTableView | A Table widget for our framework. |
| WFTableColumn | The base "view" class. Views are the components that make up a WFPage. Each page has a root view, and then is made up of various subviews in a view hierarchy. There is also a well-defined class hierarchy for WFView that contains all components that are used in creating a web page. |
| WFWidget | The base "widget" class. In our framework, all html form widgets are necessarily WFWidget subclasses. |
Constructor.
Sets up the smarty object for this module.
Add a child view to this view.
After WFPage has completed the loading of all config for all widgets, it will call this function on each widget.
This function is particularly useful for widgets that have children. When called, the widget can be sure that all instances and config of its children have been loaded from the .config file.
Get all child views of this view.
Create a clone of the WFView with a new ID.
This will give you a copy of WFView that has been registered with the page.
Is the view enabled?
Get the form associated with this element, if there is one.
Get the HTML code for all JavaScript actions.
Get the JS code to set up the PHOCOA-AJAX integrations. This is just the javascript, so that it can be include easily from <script> blocks that you already have.
Get the JS code to set up the PHOCOA-AJAX integrations. This includes the SCRIPT tags, and will be EMPTY if there are no listeners.
Get an absolute filesystem path to the www dir for graphics for this widget in the current project.
Get a relative URL path to the public www dir for graphics for this widget.
Get the id of this view. All id's on a single page are unique.
Import a CSS source file.
In *debug* mode, this will be imported by adding a <link> tag to the head element, for improved debug-ability. In normal mode, this will be imported by using an AJAX request to synchronously download the source file, then eval() it.
The advantage of the latter is that CSS files can be programmatically added via javascript code, even from code that is returned from AJAX calls.
Import a JS source file.
In *debug* mode, this will be imported by adding a <script> tag to the head element, for improved debug-ability. In normal mode, this will be imported by using an AJAX request to synchronously download the source file, then eval() it.
The eval() method has improved flexibility, because it can be used even on widget code loaded from AJAX calls with prototype's Element.update + evalScripts: true, thus allowing the loading of JS files only exactly when needed.
However, it has the downside of requiring that the js code is eval-clean (that is, unless you assign your functions to variables they will not "exist").
Helper function to get the proper "end" block for using Javascript in a web page.
Helper function to get the proper "start" block for using Javascript in a web page.
NOTE: The conventions used here are from Douglas Crockford's "Theory of DOM" video.
Remove a child view from the view hierarchy.
Render the view into HTML.
Subclasses need to start their output with the result of the super's render() method.
Set whether or not the view is enabled. Enabled views respond to the user and accept input (widgets).
Set the unique ID of this widget.
ID's are unique within a page; this function will tell the page of the new instance ID so it can be registered.
Set the "onBlur" JavaScript code for the view.
Set the "onClick" JavaScript code for the view.
Inherited From WFObject
WFObject::__construct()
WFObject::exposedProperties()
WFObject::getClass()
WFObject::keyPathToTargetAndKey()
WFObject::setValueForKey()
WFObject::setValueForKeyPath()
WFObject::validateValueForKey()
WFObject::validateValueForKeyPath()
WFObject::valueForKey()
WFObject::valueForKeyPath()
WFObject::valueForUndefinedKey()
WFObject::__toString()
Documentation generated on Thu, 17 Apr 2008 13:52:13 -0400 by phpDocumentor 1.4.1