Options
All
  • Public
  • Public/Protected
  • All
Menu

The configuration for the Signature widget. You can access this configuration via BaseWidget.cfg. Please note that this configuration is usually meant to be read-only and should not be modified.

Hierarchy

Index

Properties

background: string

The background colour of the signature area. Specify this as a six character hexadecimal value prefixed by a hash (#), as a RGB triplet, or as a named colour.

$(selector).signature({background: "#0000ff"});
$(selector).signature({background: "rgb(0,0,255)"});
$(selector).signature({background: "blue"});
base64: boolean

Whether the signature data should be saved as a base 64 string.

behaviors: Record<string, Behavior>

A map with all behaviors that were defined for this widget. The key is the name of the behavior, the value is the callback function that is invoked when the behavior is called.

change: null | OnChangeListener

This function is called when the signature is changed: either by drawing a new line on it with the mouse, by clearing it, or by re-drawing an entire signature. The function receives two parameters: the triggering event and an empty UI object. You can also bind a handler to this event using its full name signaturechange.

$(selector).signature({
change: (event, ui) => {
alert("The signature has changed");
}
});

$(selector).signature().on("signaturechange", (event, ui) => {
alert("The signature has changed");
});
color: string

The colour of the signature lines. Specify this as a six character hexadecimal value prefixed by a hash (#), as a RGB triplet, or as a named colour.

$(selector).signature({color: "#0000ff"});
$(selector).signature({color: "rgb(0,0,255)"});
$(selector).signature({color: "blue"});
disabled: boolean

Set to true to disable the signature capture functionality. You can also use the disable and enable commands for this.

distance: number

The minimum distance (pixels) of movement to start a drag operation.

$(selector).signature({distance: 5});
formId?: string

ID of the form to use for AJAX requests.

guideline: boolean

Set to true to draw a horizontal guideline within the signature area.

guidelineColor: string

The colour of the guideline (if present). Specify this as a six character hexadecimal value prefixed by a hash (#), as a RGB triplet, or as a named colour.

guidelineIndent: number

The indent (pixels) of the guideline (if present) from the sides of the signature area.

guidelineOffset: number

The offset (pixels) of the guideline (if present) from the bottom of the signature area.

id: string | string[]

The client-side ID of the widget, with all parent naming containers, such as myForm:myWidget. This is also the ID of the container HTML element for this widget. In case the widget needs multiple container elements (such as Paginator), this may also be an array if IDs.

notAvailable: string

The text to display in the signature area if the browser doesn"t support the canvas element.

Callback that is invoked when the signature changes.

postConstruct: PostConstructCallback

An optional callback that is invoked after this widget was created successfully, at the end of the init method. This is usually specified via the widgetPostConstruct attribute on the JSF component. Note that this is also called during a refresh (AJAX update).

postRefresh: PostRefreshCallback

An optional callback that is invoked after this widget was refreshed after an AJAX update, at the end of the refresh method. This is usually specified via the widgetPostRefresh attribute on the JSF component.

preDestroy: PreDestroyCallback

An optional callback that is invoked before this widget is about to be destroyed, e.g., when the component was removed at the end of an AJAX update. This is called at the beginning of the destroy method. This is usually specified via the widgetPreDestroy attribute on the JSF component.

readonly: boolean

Whether the signature widget is readonly.

svgStyles: boolean

Set to true to apply styles in SVG using the style attribute, rather than using individual inline attributes.

$(selector).signature({svgStyles: true});
since

1.2.0

syncField: null | string | HTMLElement | JQuery<HTMLElement>

The element to keep synchronised with the JSON text for the signature. The value may be a string selector, a DOM element, or a jQuery object.

$(selector).signature({syncField: "#jsonSignature"});
syncFormat: SyncFormat

The output representation that is automatically generated into the syncField. PNG and JPEG output are generated as data URIs.

since

1.2.0

thickness: number

The thickness of the lines used to draw the signature.

widgetVar: string

The name of the widget variables of this widget. The widget variable can be used to access a widget instance by calling PF("myWidgetVar").

Generated using TypeDoc