For instance, see control-settings.xbl, an example of custom Control Settings that lets form authors enter, for each control, a "question identifier", which value is stored in an attribute of the form data, on the element corresponding that corresponds to the current control.
For an example template, see above for acme:form-settings.
Responding to events
Form Builder dispatches the following events to the component:
fb-initialize is dispatched to initialize the tab when the dialog shows.
fb-apply is dispatched to save the settings, if any, to the form definition.
Handlers for these events can access the form definition and read from / write to it. Component authors have to be very careful not damaging the form definition in the process.
fb-initialize and fb-apply both take the following parameters:
root element of the form definition
root element of the form definition's form instance
root element of the form definition's form metadata
all data holders for the given control
In addition, fb-initialize takes the following parameters:
original control id, such as first-name-control
original control name, such as first-name
In addition, fb-apply takes the following parameters:
new control name, such as first-name
Between fb-initialize and fb-apply, the control name (and id) might have been changed in the dialog by the user. The original-control-name and control-name parameters reflect that change when needed.