Class pvr.widget.View
Extends
dijit.layout._LayoutWidget, dijit._TemplatedMixin, dijit._WidgetsInTemplateMixin.
Represents a view composed of an arbitrary containment of container and pvr.widget.Property
widgets.
There are three ways to compose the view.
- Set the "markup" and "resources" parameters. You can use the Properties View Designer to design such a view definition.
- Build the view programmatically calling the addChild method of the view and its contained objects.
- Auto-generate the view during the {@pvr.widget.View#bind} method using the properties defined in the pvr.controller.PropertyCollectionController object.
After composing the view, you must call the {@pvr.widget.View#bind} method to bind each pvr.widget.Property object defined in the view with its associated prv.controller._PropertyController object in the pvr.controller.PropertyCollectionController object. Each property has a "binding" setting that references its associated property controller. When the binding is resolved, an editor widget for the property is created, configured and populated based on the settings in both the property and the property controller. If the binding cannot be resolved, the property is removed from the view. Any empty containers are also removed from the view, provided they are not configured to remain in the view when empty.
The pvr.widget.registry.Registry object passed to the {@pvr.widget.View#bind} method is used to guide each property in selecting the appropriate editor widget to render. If the configured editor widget is invalid or if the view is system-generated, the registry will recommend an appropriate default editor widget for the property.
Defined in: <pvr\widget\View.js>.
Constructor Summary
Constructor Attributes | Constructor Name and Description |
---|---|
Field Summary
Field Attributes | Field Name and Description |
---|---|
A comparator function that provides the sort order of the properties included in a system-generated view.
|
|
The pvr.controller.PropertyCollectionController object provided in the
binding.
|
|
Indicates whether the view is disabled.
|
|
A filter function that indicates which properties should be included in a system-generated view.
|
|
Indicates whether lazy loading will be supported in the view.
|
|
The markup associated with the view definition.
|
|
The collection of pvr.widget.Property objects contained in the view that
were bound to a pvr.controller._PropertyController object.
|
|
An array of binding references for each property to be be included a system-generated view.
|
|
Indicates whether the view is read-only.
|
|
The pvr.widget.registry.Registry object provided in the binding.
|
|
The resources associated with the view definition.
|
|
The settings provided in the binding.
|
|
Indicates whether the progress dialog should be displayed when loading the view.
|
|
The state of the view.
|
Method Summary
Method Attributes | Method Name and Description |
---|---|
bind(controller, registry, settings, callback)
Binds the view to the specified pvr.controller.PropertyCollectionController object and calls the
specified callback function when complete.
|
|
destroy()
|
|
everyProperty(options)
Calls the specified callback function for the pvr.widget.Property objects included by the options.
|
|
forEachProperty(options)
Process each of the pvr.widget.Property objects included by the options.
|
|
getProperties(options)
Returns the pvr.view.Property objects included by the options.
|
|
getProperty(collectionId, propertyId)
Returns the pvr.widget.Property objects whose binding matches the specified property reference.
|
|
Indicates whether any property's value was modified.
|
|
layout()
|
|
mapProperty(options)
Creates a new array by processing the pvr.widget.Property objects included by the options.
|
|
onLoaded()
An event called with the view is loaded.
|
|
Resets the modified state of every property.
|
|
someProperty(options)
Calls the specified callback function for the pvr.widget.Property objects included by the options.
|
|
unbind()
Releases the binding of the view to the property collection controller.
|
|
validate()
Validates the properties and returns an array of pvr.widget.Property objects whose editors failed
validation.
|
Field Detail
comparator
{object} controller
disabled
Use this setting to temporarily disable user input when loading the view, for example.
filter
lazyLoad
markup
{object} properties
propertyIds
readOnly
Use this setting for a view that is for display only.
{object} registry
resources
{object} settings
showProgress
state
Method Detail
bind(controller, registry, settings, callback)
The specified pvr.widget.registry.Registry object is used to guide each property in selecting the appropriate editor widget to render.
A settings object provides extra guidance in the configuration of the view.
For every call to pvr.widget.View#bind there must be a matching call to pvr.widget.View#unbind to prevent memory leaks.
- Parameters:
- controller
- The property collection controller.
- registry
- The registry.
- settings
- The settings.
- callback
- the callback function.
destroy()
everyProperty(options)
- Parameters:
- options
- The options.
- options.callback
- The callback function to be called for each pvr.widgetProperty object that meets the criteria specified by the other options. The callback should return true if the processing should continue or false to abort the processing. (required)
- options.filter
- A filter function that indicates which properties should be included. (optional)
- options.comparator
- A comparator function that provides the sort order of the properties included. (optional)
- Returns:
- true if the callback function returns true for every pvr.view.Property object.
forEachProperty(options)
- Parameters:
- options
- The options.
- options.callback
- The callback function to be called for each pvr.widgetProperty object that meets the criteria specified by the other options. (required)
- options.filter
- A filter function that indicates which properties should be included. (optional)
- options.comparator
- A comparator function that provides the sort order of the properties included. (optional)
getProperties(options)
- Parameters:
- options
- The options.
- options.filter
- A filter function that indicates which properties should be included. (optional)
- options.comparator
- A comparator function that provides the sort order of the properties included. (optional)
- Returns:
- The array of pvr.view.Property objects.
getProperty(collectionId, propertyId)
May return multiple pvr.widget.Property objects since the same property can be added to the view more than once.
The following method signatures are supported.
getProperty(collectionId, propertyId) getProperty(binding) getProperty({ collectionId: collectionId, id: propertyId })
- Parameters:
- collectionId
- The identifier for the property collection.
- propertyId
- The identifier for the property.
- Returns:
- An array of pvr.view.Property objects.
isModified()
Returns true even if the new value was not committed to the controller because of invalid data.
- Returns:
- true if any property's value was modified.
layout()
mapProperty(options)
- Parameters:
- options
- The options.
- options.callback
- The callback function to be called for each pvr.widgetProperty object that meets the criteria specified by the other options. The callback returns the corresponding value for the new array. (required)
- options.filter
- A filter function that indicates which properties should be included. (optional)
- options.comparator
- A comparator function that provides the sort order of the properties included. (optional)
- Returns:
- The new array.
onLoaded()
postMixInProperties()
resetModified()
someProperty(options)
- Parameters:
- options
- The options.
- options.callback
- The callback function to be called for each pvr.widgetProperty object that meets the criteria specified by the other options. The callback should return true to abort the processing or false if the processing should continue.(required)
- options.filter
- A filter function that indicates which properties should be included. (optional)
- options.comparator
- A comparator function that provides the sort order of the properties included. (optional)
- Returns:
- true if the callback function returns true for any pvr.view.Property object.
unbind()
For every call to pvr.widget.View#bind there must be a matching call to pvr.widget.View#unbind to prevent memory leaks.
validate()
An empty array indicates that the data is valid.
Unbound Property objects are not included in the search.
- Returns:
- An array of invalid properties.