Signature"

From Documentation
 
(20 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Template:Smalltalk_Author|
+
{{ZKComponentReferencePageHeader}}
|author=Hawk Chen, Engineer, Potix Corporation
 
|date=2018
 
|version=ZK 8.6.0}}
 
  
__TOC__
+
= Signature =
 
+
{{versionSince| 8.6.0}}
 
 
= Introduction =
 
Rich and reusable components are the main reason that people adopt ZK. In 8.6 release, we focus on making components more powerful, we create several new components for multimedia and enhance some components to support more features.  
 
 
 
Highlighted features:
 
* 8 new components
 
* Compact theme
 
 
 
== Download and Demo ==
 
<br />
 
<div style="float: left;"><imagelink link="http://www.zkoss.org/download/zk" image="/_w/images/0/00/Download-zk-7.png" /></div>
 
<div style="float: left"><imagelink link="http://www.zkoss.org/zkdemo/" image="/_w/images/6/68/Demo-zk-7.png" /></div>
 
<br />
 
<br />
 
<br />
 
<br />
 
<br />
 
<div style="height:70px; border-radius:5px;font-family: 'Didact Gothic', sans-serif; text-align:center; padding:5px; background-color: #0093f9;">
 
<h1 style="margin: 5px;padding-bottom: 15px;border:2px dashed #F7EEEE;color:#fff;">Highlighted Features</h1>
 
</div>
 
 
 
= Refresh Theme without Change - Compact Theme =
 
{{ZK All}}
 
The new default theme iceblue is great. But we also hear from some users' voice, we now build a compact theme to let you refresh your application's looking without modification.
 
 
 
Please check them at [https://www.zkoss.org/zk85themedemo/ Theme Demo]
 
 
 
= [[ZK%20Component%20Reference/Layouts/GoldenLayout| Multi-Screen Layout - Goldenlayout]] =
 
<!-- http://tracker.zkoss.org/browse/ZK-3954 -->
 
 
{{ZK EE}}
 
{{ZK EE}}
  
GoldenLayout is a layout container which layouts panels as docker type. You can drag a panel to dock at 4 regions (north, east, south, west) or to stack on another panel. This component is suitable for building a workspace like interface.
+
*Java API: <javadoc>org.zkoss.zkmax.zul.Signature</javadoc>
 +
*JavaScript API: <javadoc directory="jsdoc">zkmax.wgt.Signature</javadoc>
  
[[File:goldenlayout.gif | center]]
+
= Browser Support =
 +
*This component supports IE10+ and modern browsers.
  
 +
= Employment/Purpose =
 +
Signature components support signature pad on the desktop and mobile browsers. User can customize pen size, pen color, background color etc., it also provides undo, save and clear methods.
  
= [[ZK_Component_Reference/Multimedia_and_Miscellaneous/Video|Video Player]] =
+
= Example =
{{ZK All}}
+
[[File:Signature.png]]
  
[[Image:video-player.gif | center]]
+
<source lang="xml" >
 +
<signature width="600px" height="300px" penColor="white" backgroundColor="#AED6F1" penSize="6"/>
 +
</source>
  
With this component, you can build your own youtube or a online school.
+
== Buttons ==
  
= [[ZK_Component_Reference/Multimedia_and_Miscellaneous/Camera| Take a Photo - Camera]] =
+
There are 3 buttons when you hover on this component: (from left to right)
<!-- http://tracker.zkoss.org/browse/ZK-3930 -->
 
{{ZK EE}}
 
  
 +
# '''undo''': to remove the last step that was drawn on the signature pad.
 +
# '''save''': to save the signature image to the server, a user can get the image by listening onSave event.
 +
# '''clear''': to clear signature pad.
  
= [[ZK_Component_Reference/Multimedia_and_Miscellaneous/Camera|Record a Clip]] =
+
= toolbarVisible =
{{ZK EE}}
 
  
 +
The toolbar contains 3 buttons: undo button, clear button, and save button. They are visible by default. If you can hide them:
  
= [[ZK%20Component%20Reference/Layouts/Organigram| Show Your Organization - Organigram]] =
+
<source lang="xml">
{{ZK EE}}
+
<signature toolbarVisible="false"/>
 +
</source>
  
The component can render a organizational chart upon a <tt>TreeModel</tt>.
+
The toolbar buttons only contain icons by default. If you want to show message after icons on the buttons, we provide three attributes: <code>undoLabel</code>, <code>clearLabel</code>, and <code>saveLabel</code>.
  
[[Image:organigram.gif | center]]
+
Default:
  
= [[ZK%20Component%20Reference/Input/Signature| Sign Here, Please]] =
+
[[File:Signature toolbar.png]]
<!-- http://tracker.zkoss.org/browse/ZK-3959 -->
 
{{ZK EE}}
 
  
[[File:sinature.gif | center]]
+
Customized:
  
[[ZK_Component_Reference/Input/Signature| Signature]] supports singature pad on the desktop and mobile browsers. Developers can setup pen size, pen color, and background color etc. Users can undo, save and clear their signatres.
+
[[File:Signature toolbar2.png]]
 +
<source lang="xml">
 +
<signature undoLabel="Undo" clearLabel="Clear" saveLabel="Save"/>
 +
</source>
  
= [[ZK%20Component%20Reference/Essential%20Components/Rating| Give Me a Rating]] =
+
= Style Attributes =
<!-- http://tracker.zkoss.org/browse/ZK-3960 -->
 
{{ZK EE}}
 
  
[[File:rating.gif | center]]
+
There are some attributes to adjust the signature style:
  
 +
== penSize==
 +
the width of a line on the signature, the default is 1.
  
= [[ZK%20Component%20Reference/Multimedia%20and%20Miscellaneous/Barcode| Display]] and Scan a Barcode =
+
== penColor ==
{{ZK EE}}
+
Can be any color format accepted by context.fillStyle(canvas), defaults to black.
  
= [[ZK_Component_Reference/Input/Checkbox#Mold| Ios Style Switch and Toggle]] =
+
== backgroundColor==  
<!-- http://tracker.zkoss.org/browse/ZK-3958 -->
+
Can be any color format accepted by context.fillStyle(canvas), defaults to white.
{{ZK All}}
 
Checkbox supports 2 new molds:
 
== Ios Style Switch ==
 
[[File:checkbox-ios-style-switch.gif | center]]
 
  
== Toggle ==
+
== backgroundImage==  
[[File:checkbox-toggle.gif | center]]
+
{{versionSince| 9.6.0}}
 +
Can be any image format accepted by context.drawImage(canvas), defaults to null.
  
Check [[ZK%20Component%20Reference/Input/Checkbox| Component Reference]].
+
= BackgroundIncluded =
 +
{{versionSince |9.6.0}}
  
= [[ZK_Component_Reference/Input/Checkbox| 3 States Checkbox]] =
+
The background color and image will be saved by default.  If you don't want to save the background color and image, please use the following setting.
<!-- http://tracker.zkoss.org/browse/ZK-136 -->
+
<source lang="xml">
 
+
<signature backgroundIncluded="false"/>
Checkbox supports intermediate states:
+
</source>
[[File:checkbox-3states.png | center]]
 
  
 +
== Scanned Paper Form==
 +
You can load a scanned paper form as a background and save it with a signature.
 +
[[File:Paper-form.jpg|center]]
  
= [[ZK_Component_Reference/Input/Slider| Knob-like Slider]] =  
+
= Saves Signature Image =
<!-- http://tracker.zkoss.org/browse/ZK-3961 -->
 
{{ZK All}}
 
Set the mold attribute with <tt>knob</tt> will enable knob slider. So the slider can act as a normal knob. You can controll by wheel, drag, click and enter a value to the textbox in the center.
 
  
[[File:knob-slider.gif | center]]
+
After clicking "Save" button, the component will upload the signature to a server. You can listen <code>onSave</code> to get the uploaded signature and show it with [https://www.zkoss.org/wiki/ZK_Component_Reference/Essential_Components/Image Image]:
  
 
+
<source lang="xml">
= [[ZK%20Component%20Reference/Multimedia%20and%20Miscellaneous/Cropper| Crop a Uploaded Image]] =
+
<signature onSave="image.setContent(event.getMedia())"/>
<!-- http://tracker.zkoss.org/browse/ZK-3962 -->
+
<image id="image"/>
{{ZK EE}}
 
 
 
[[File:cropper.gif | center]]
 
 
 
= [[ZK%20Component%20Reference/Essential%20Components/Toolbar| Toolbar Accommodates More Buttons]] =
 
<!-- http://tracker.zkoss.org/browse/ZK-3179 -->
 
{{ZK All}}
 
When <tt>overflowPopup="true"</tt>, a toolbar will have a <tt>...</tt> symbol that shows a popup which contains those buttons weren't able to fit in the toolbar.
 
 
 
[[File:Toolbar-overflowPopup.gif | center]]
 
 
 
 
 
= Page Navigation Helper=
 
<!-- http://tracker.zkoss.org/browse/ZK-4028 -->
 
{{ZK All}}
 
 
 
<br/>
 
<div style="height:70px; border-radius:5px;font-family: 'Didact Gothic', sans-serif; text-align:center; padding:5px; background-color: #0093f9;">
 
<h1 style="margin: 5px;padding-bottom: 15px;border:2px dashed #F7EEEE;color:#fff;">Other Enhancements</h1>
 
</div>
 
 
 
 
 
= [[ZK%20Component%20Reference/Essential%20Components/Menu/Menupopup| Guide Users with a Pop-up Menuitem]] =
 
{{ZK All}}
 
 
 
If you want to guide new users to click a menuitem or open a menupopup for them, ZK provide a method to pop up the menuitem in front of users.
 
 
 
[[File:menuitem-setactive.gif | center]]
 
 
 
<source lang='java'>
 
menu.getMenupopup().setActive(i);
 
 
</source>
 
</source>
  
= Web Fragment =
+
== File Size Limit ==  
 
+
If you see <code>SizeLimitExceededException</code>, you can adjust max uploading file size by
= Improved Rendering Speed =  
+
[[ZK_Configuration_Reference/zk.xml/The_system-config_Element/The_max-upload-size_Element | file-size-threshold]].
<!--
 
http://tracker.zkoss.org/browse/ZK-3978
 
http://tracker.zkoss.org/browse/ZK-3986
 
-->
 
 
 
We improve the rendering speed when opening a tree node and a model change of a chosenbox.
 
 
 
= Summary =
 
ZK is made by Java developers for Java developers; continue bringing technology innovations to enterprise Java web development has always been our top priority. ZK 8.5 provides a great balance between the required server-side simplicity, security, and integrity and the client-side usability, look, and feel. <br/>Join us this fall and harvest Javascript from Java roots!
 
<br />
 
<br/>
 
  
<div style="float: left;"><imagelink link="http://www.zkoss.org/download/zk" image="/_w/images/0/00/Download-zk-7.png" /></div>
+
=Supported Events=
  
<br />
+
{| class='wikitable' | width="100%"
<br/>
+
! <center>Name</center>
<br/>
+
! <center>Event Type</center>
 +
|-
 +
| <center>onSave</center>
 +
| '''Event:''' <javadoc>org.zkoss.zk.ui.event.UploadEvent</javadoc>
 +
When user invoke the save method, the event would be triggered.
 +
|-
 +
| <center>onClear</center>
 +
| '''Event:''' <javadoc>org.zkoss.zk.ui.event.Event</javadoc>
 +
When user invoke the clear method, the event would be triggered.
 +
|}
  
ZK grows with you. Feel free to [https://www.zkoss.org/support/about/contact share with us] your feedback or suggestion.
+
=Version History=
 +
{{LastUpdated}}
 +
{| class='wikitable' | width="100%"
 +
! Version !! Date !! Content
 +
|-
 +
| 8.6.0
 +
| August 2018
 +
|
 +
|}
  
{{Template:CommentedSmalltalk_Footer_new|
+
{{ZKComponentReferencePageFooter}}
|name=Potix Corporation
 
}}
 

Latest revision as of 10:15, 19 September 2022

Signature

Since 8.6.0

  • Available for ZK:
  • http://www.zkoss.org/product/zkhttp://www.zkoss.org/whyzk/zkeeVersion ee.png

Browser Support

  • This component supports IE10+ and modern browsers.

Employment/Purpose

Signature components support signature pad on the desktop and mobile browsers. User can customize pen size, pen color, background color etc., it also provides undo, save and clear methods.

Example

Signature.png

<signature width="600px" height="300px" penColor="white" backgroundColor="#AED6F1" penSize="6"/>

Buttons

There are 3 buttons when you hover on this component: (from left to right)

  1. undo: to remove the last step that was drawn on the signature pad.
  2. save: to save the signature image to the server, a user can get the image by listening onSave event.
  3. clear: to clear signature pad.

toolbarVisible

The toolbar contains 3 buttons: undo button, clear button, and save button. They are visible by default. If you can hide them:

<signature toolbarVisible="false"/>

The toolbar buttons only contain icons by default. If you want to show message after icons on the buttons, we provide three attributes: undoLabel, clearLabel, and saveLabel.

Default:

Signature toolbar.png

Customized:

Signature toolbar2.png

<signature undoLabel="Undo" clearLabel="Clear" saveLabel="Save"/>

Style Attributes

There are some attributes to adjust the signature style:

penSize

the width of a line on the signature, the default is 1.

penColor

Can be any color format accepted by context.fillStyle(canvas), defaults to black.

backgroundColor

Can be any color format accepted by context.fillStyle(canvas), defaults to white.

backgroundImage

Since 9.6.0 Can be any image format accepted by context.drawImage(canvas), defaults to null.

BackgroundIncluded

Since 9.6.0

The background color and image will be saved by default. If you don't want to save the background color and image, please use the following setting.

<signature backgroundIncluded="false"/>

Scanned Paper Form

You can load a scanned paper form as a background and save it with a signature.

Paper-form.jpg

Saves Signature Image

After clicking "Save" button, the component will upload the signature to a server. You can listen onSave to get the uploaded signature and show it with Image:

	<signature onSave="image.setContent(event.getMedia())"/>
	<image id="image"/>

File Size Limit

If you see SizeLimitExceededException, you can adjust max uploading file size by file-size-threshold.

Supported Events

Name
Event Type
onSave
Event: UploadEvent

When user invoke the save method, the event would be triggered.

onClear
Event: Event

When user invoke the clear method, the event would be triggered.

Version History

Last Update : 2022/09/19


Version Date Content
8.6.0 August 2018



Last Update : 2022/09/19

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.