SignatureField

Vaadin field to capture signatures.

License

License

Categories

Categories

Vaadin User Interface Web Frameworks
GroupId

GroupId

eu.maxschuster
ArtifactId

ArtifactId

vaadin-signaturefield
Last Version

Last Version

2.0.1
Release Date

Release Date

Type

Type

bundle
Description

Description

SignatureField
Vaadin field to capture signatures.
Project URL

Project URL

https://github.com/maxschuster/Vaadin-SignatureField
Project Organization

Project Organization

Max Schuster
Source Code Management

Source Code Management

https://github.com/maxschuster/Vaadin-SignatureField.git

Download vaadin-signaturefield

Dependencies

compile (2)

Group / Artifact Type Version
com.vaadin : vaadin-compatibility-server jar 8.0.5
eu.maxschuster : dataurl jar 2.0.0

provided (1)

Group / Artifact Type Version
com.vaadin : vaadin-compatibility-client jar 8.0.5

test (2)

Group / Artifact Type Version
junit : junit jar 4.12
javax.servlet : javax.servlet-api jar 3.0.1

Project Modules

There are no modules declared in this project.

SignatureField

A Vaadin Field<String> to capture signatures. Its value is the data url from the html canvas as simple String. signature_pad by Szymon Nowak is used to capture the signature at the client-side.

Requirements

  • Vaadin 7.4+

Demo

http://maxschuster.jelastic.servint.net/SignatureField/

Usage

Simple

FormLayout layout = new FormLayout();

SignatureField signatureField = new SignatureField();
signatureField.setWidth("350px");
signatureField.setHeight("150px");

layout.addComponent(signatureField);

signatureField.addValueChangeListener(new ValueChangeListener() {
	@Override
	public void valueChange(ValueChangeEvent event) {
		String signature = (String) event.getProperty().getValue();
		// do something with the string
	}
});

Using DataURL

ObjectProperty<DataURL> dataUrlProperty =
	new ObjectProperty<DataURL>(null, DataURL.class);

FormLayout layout = new FormLayout();

SignatureField signatureField = new SignatureField();
signatureField.setWidth("350px");
signatureField.setHeight("150px");
signatureField.setConverter(new StringToDataURLConverter());
signatureField.setPropertyDataSource(dataUrlProperty);

layout.addComponent(signatureField);

dataUrlProperty.addValueChangeListener(new ValueChangeListener() {
	@Override
	public void valueChange(ValueChangeEvent event) {
		final DataURL signature = (DataURL) event.getProperty().getValue();
		String mimeType = signature.getAppliedMimeType();
		byte[] data = signature.getData();
		// do something with the data
	}	
});

Licence

  • SignatureField Add-on: Apache License Version 2.0
  • signature_pad: MIT License

Versions

Version
2.0.1
2.0.0
1.0.2
1.0.1
1.0.0