Class Index | File Index

Classes


Class metawidget.widgetprocessor.SimpleBindingProcessor

Simple data/action binding implementation. Frameworks that supply their own data-binding mechanisms (such as Angular JS) should override this with their own WidgetProcessor.
Defined in: metawidget-widgetprocessors.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Method Summary
Method Attributes Method Name and Description
 
bindToWidget(widget, value, elementName, attributes, mw)
Bind the given widget to the given value.
 
getWidgetFromBinding(binding, mw)
Returns the widget associated with the given binding.
 
 
processWidget(widget, elementName, attributes, mw)
 
reload(reloadFrom, mw)
Reloads the values in the widgets using the values in the given Object.
 
save(mw)
Save the bindings associated with the given Metawidget.
 
saveFromWidget(binding, mw)
Class Detail
metawidget.widgetprocessor.SimpleBindingProcessor()
Method Detail
bindToWidget(widget, value, elementName, attributes, mw)
Bind the given widget to the given value.
Parameters:
widget
value
elementName
attributes
mw
Returns:
true if this binding should be remembered for when the user calls 'save'

getWidgetFromBinding(binding, mw)
Returns the widget associated with the given binding. By default, calls binding.widget. Subclasses may override this method if their framework has swapped out the widget.
Parameters:
binding
mw

onStartBuild(mw)
Parameters:
mw

processWidget(widget, elementName, attributes, mw)
Parameters:
widget
elementName
attributes
mw

reload(reloadFrom, mw)
Reloads the values in the widgets using the values in the given Object. The names of the values in the Object must match the 'name' attribute of the widget.

Note this method does not update mw.toInspect, nor does it save any values back from the widgets. It can be useful for re-populating the widgets based on an HTTP request POST-back.

Parameters:
reloadFrom
mw

save(mw)
Save the bindings associated with the given Metawidget.
Parameters:
mw
Returns:
true if data (including data from nested Metawidgets) was actually changed. False otherwise. Can be useful for 'dirty' flags

saveFromWidget(binding, mw)
Parameters:
binding
mw
Returns:
the given binding's widget value

Documentation generated by JsDoc Toolkit 2.3.2 on Mon Dec 14 2015 20:12:12 GMT-0500 (EST)