Class Widget

Base class for all widget objects.

Part of:

package weblocks, class pagination, class login, class flash, class dispatcher, class dataseq, class data-editor, class composite, class dom-object-mixin

Direct Superclass

dom-object-mixinRepresents attributes and functionality common to all
DOM-renderable objects.

Direct Subclass

compositeA composite widget is simply a container for other
widgets. The 'widgets' slot accessible with ...
data-editorThe details of stateful handling of forms
manipulating objects. Mix this in to drop-in your ow...
dataseqA base class for widgets that are designed to
present a sequence of data items. This class prov...
dispatcherThe dispatcher widget can be used to map a sequence
of URL tokens to a widget corresponding to ...
flashA widget that allows displaying a message that
disappears on the following request. It is usefu...
loginA widget that provides basic login
functionality. Based on a view to be rendered (or a default ...
paginationThe pagination widget can be used to provide UI to
break up large amount of data into pages.

Slot

continuation
Stores the continuation object for widgets that were invoked via one of the do-* functions ('do-page', etc.). When 'answer' is called on a widget, this value is used to resume the computation.
Accessors:widget-continuation.
dom-class
The DOM class (CSS class) of an object. Set this to a string if you'd like to add an additional CSS class to the ones generated from the class hierarchy by default.
Initargs::dom-class; Accessors:dom-class.
dom-id
The DOM id of an object. Can be a symbol, a string or nil. When accessed through the 'dom-id' accessor, will always become a string. Use ensure-dom-id or widget-name (for widgets) to access its underlying implementation.
Initargs::dom-id.
propagate-dirty
A list of widget paths (see 'find-widget-by-path') or widgets each of which will be made dirty when this widget is made dirty via a POST request. This slot allows setting up dependencies between widgets that will make multiple widgets update automatically during AJAX requests.
Initargs::propagate-dirty; Accessors:widget-propagate-dirty.
renderedp
This slot holds a boolean flag indicating whether the widget has been rendered at least once. Because marking unrendered widgets as dirty may cause JS problems, 'mark-dirty' will use this flag to determine the status of a widget.
Accessors:widget-rendered-p.
widget-prefix-fn
A function called prior to rendering the widget body. The function should expect the widget as well as any additional arguments passed to the widget.
Initargs::widget-prefix-fn; Accessors:widget-prefix-fn.
widget-suffix-fn
A function called after rendering the widget body. The function should expect the widget as well as any additional arguments passed to the widget.
Initargs::widget-suffix-fn; Accessors:widget-suffix-fn.

Direct Method

composite-widgets
find-widget-by-path*Returns a widget object located at 'path', where 'path' is a list
of widget names starting from r...
mark-dirtyDefault implementation adds a widget to a list of dirty
widgets. Normally used during an AJAX req...
setfwidget-name
setfwidget-parent
widget-nameAn interface to the DOM id of a widget. Provides
access to the underlying implementation, can r...

Other Method

dom-classesReturns a string that represents all applicable CSS
classes for an object (usually a widget). Nor...
dom-idProvides a consistent interface to identifying widgets
by their DOM id. Returns a string or nil i...
ensure-dom-idEnsure that the object has a 'dom-id' and return
it. 'dom-id' is lazily generated on first read...
setfdom-id