Class Dataform

A class that represents a dataform widget. By default this widget
renders the data object with a data view along with a 'modify'
link. If the user clicks on the link, the widget's state is updated
and it renders into a form via a form view. If a user then submits the
form, the data object is updated from the form (see
dataform-submit-action).

Part of:

package weblocks, class widget

Direct Superclass

widgetBase class for all widget objects.

Slot

allow-close-p
If set to true (the default), and 'on-close' isn't nil, renders a close button.
Initform:t, Initargs::allow-close-p; Accessors:dataform-allow-close-p.
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.
data
Data object rendered and modified by this widget.
Initargs::data; Accessors:dataform-data.
data-view
View object used to render 'data' object into information view. If 'data-view' isn't provided, the scaffold view will be used by default.
Initargs::data-view; Accessors:dataform-data-view.
form-title
Title of the dataform in form mode. If not specified, default for the view will be used.
Initargs::form-title; Accessors:dataform-form-title.
form-view
View object used to render 'data' object into form view. If 'form-view' isn't provided, the scaffold view will be used by default.
Initargs::form-view; Accessors:dataform-form-view.
intermediate-form-values
If user enters form values and validation fails, these values are stored in this variable so the form isn't lost while the user fixes errors.
name
A name of the widget used in rendering CSS classes. If the name is not provided it will be generated automatically with 'generate-widget-id'.
Initform:(generate-widget-id), Initargs::name; Accessors:widget-name.
on-cancel
An optional callback function with one argument (the dataform widget). Called when the user presses a cancel button.
Initargs::on-cancel; Accessors:dataform-on-cancel.
on-close
An optional callback function with one argument (the dataform widget). Called when the user clicks on the close button. Note that the close button is only rendered if 'allow-close-p' is true.
Initargs::on-close; Accessors:dataform-on-close.
on-success
An optional callback function with one argument (the dataform widget). Called when the user successfully submitted data that passed through the validation stage.
Initargs::on-success; Accessors:dataform-on-success.
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.
ui-state
A state of the gridedit control. When set to nil, gridedit simply renders an 'add entry' button and a 'delete entry' button, assuming they are permitted (see 'allow-add-p' and 'allow-delete-p'). When set to :add, renders an empty form that allows adding a new entry. When set to :drilldown, renders details for a particular item.
Initargs::ui-state; Accessors:gridedit-ui-state.
validation-errors
An association list of slot names and validation errors that occurred during the previous form submission.
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

dataform-data-view
dataform-form-view
dataform-submit-actionCalled when the user invokes a submit action on a dataform
widget. The default implementation upd...
render-dataformRenders the dataform widget in its current state. Normally called
by 'render-widget-body'. Overri...
render-dataform-dataRenders the dataform widget when it's in ':data'
state. Normally called by 'render-dataform'. Ove...
render-dataform-formRenders the dataform widget when it's in ':form'
state. Normally called by 'render-dataform'. Ove...
render-widget-bodyA generic function that renders a widget in its current state. In
order to actually render the wi...

Other 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...
widget-css-classesReturns a string that represents applicable CSS
classes for 'widget'. Normally includes the class...