Signature"

From Documentation
 
(18 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.
 
 
 
[[Image:compact-theme.png | center]]
 
 
 
Please check them at [https://www.zkoss.org/zk85themedemo/ Theme Demo]
 
 
 
 
 
= [[ZK_Component_Reference/Multimedia_and_Miscellaneous/Video|Video Player]] =
 
{{ZK All}}
 
 
 
[[Image:video-player.gif | center]]
 
 
 
With this component, you can build your own youtube or a online school.
 
 
 
= [[ZK_Component_Reference/Input/Checkbox#Mold| Ios Style Switch and Toggle]] =
 
<!-- http://tracker.zkoss.org/browse/ZK-3958 -->
 
{{ZK All}}
 
Checkbox supports 2 new molds:
 
== Ios Style Switch ==
 
[[File:checkbox-ios-style-switch.gif | center]]
 
 
 
== Toggle ==
 
[[File:checkbox-toggle.gif | center]]
 
 
 
Check [[ZK%20Component%20Reference/Input/Checkbox| Component Reference]].
 
 
 
= [[ZK_Component_Reference/Input/Checkbox| 3 States Checkbox]] =
 
<!-- http://tracker.zkoss.org/browse/ZK-136 -->
 
{{ZK All}}
 
Checkbox supports intermediate states:
 
[[File:checkbox-3states.png | center]]
 
 
 
 
 
= [[ZK_Component_Reference/Input/Slider| Knob-like Slider]] =
 
<!-- 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]]
 
 
 
 
 
= [[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}}
 
 
 
= [[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.
  
 +
= Example =
 +
[[File:Signature.png]]
  
= [[ZK_Component_Reference/Multimedia_and_Miscellaneous/Camera| Take a Photo - Camera]] =
+
<source lang="xml" >
<!-- http://tracker.zkoss.org/browse/ZK-3930 -->
+
<signature width="600px" height="300px" penColor="white" backgroundColor="#AED6F1" penSize="6"/>
{{ZK EE}}
+
</source>
  
 +
== Buttons ==
  
= [[ZK_Component_Reference/Multimedia_and_Miscellaneous/Camera|Record a Clip]] =
+
There are 3 buttons when you hover on this component: (from left to right)
{{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%20Component%20Reference/Layouts/Organigram| Show Your Organization - Organigram]] =  
+
= toolbarVisible =
{{ZK EE}}
 
  
The component can render a organizational chart upon a <tt>TreeModel</tt>.
+
The toolbar contains 3 buttons: undo button, clear button, and save button. They are visible by default. If you can hide them:
  
[[Image:organigram.gif | center]]
+
<source lang="xml">
 +
<signature toolbarVisible="false"/>
 +
</source>
  
= [[ZK%20Component%20Reference/Input/Signature| Sign Here, Please]] =
+
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>.
<!-- http://tracker.zkoss.org/browse/ZK-3959 -->
 
{{ZK EE}}
 
  
[[File:sinature.gif | center]]
+
Default:
  
[[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 toolbar.png]]
  
= [[ZK%20Component%20Reference/Essential%20Components/Rating| Give Me a Rating]] =
+
Customized:
<!-- http://tracker.zkoss.org/browse/ZK-3960 -->
 
{{ZK EE}}
 
  
[[File:rating.gif | center]]
+
[[File:Signature toolbar2.png]]
 +
<source lang="xml">
 +
<signature undoLabel="Undo" clearLabel="Clear" saveLabel="Save"/>
 +
</source>
  
 +
= Style Attributes =
  
= [[ZK%20Component%20Reference/Multimedia%20and%20Miscellaneous/Cropper| Crop a Uploaded Image]] =
+
There are some attributes to adjust the signature style:
<!-- http://tracker.zkoss.org/browse/ZK-3962 -->
 
{{ZK EE}}
 
  
[[File:cropper.gif | center]]
+
== 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.
  
 +
== backgroundColor==
 +
Can be any color format accepted by context.fillStyle(canvas), defaults to white.
  
<br/>
+
== backgroundImage==
<div style="height:70px; border-radius:5px;font-family: 'Didact Gothic', sans-serif; text-align:center; padding:5px; background-color: #0093f9;">
+
{{versionSince| 9.6.0}}
<h1 style="margin: 5px;padding-bottom: 15px;border:2px dashed #F7EEEE;color:#fff;">Other Enhancements</h1>
+
Can be any image format accepted by context.drawImage(canvas), defaults to null.
</div>
 
  
 +
= BackgroundIncluded =
 +
{{versionSince |9.6.0}}
  
= [[ZK%20Component%20Reference/Essential%20Components/Menu/Menupopup| Guide Users with a Pop-up Menuitem]] =
+
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.
{{ZK All}}
+
<source lang="xml">
 
+
<signature backgroundIncluded="false"/>
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 =
+
== Scanned Paper Form==
{{ZK All}}
+
You can load a scanned paper form as a background and save it with a signature.
We now separate ZK web fragment support into [http://mavensync.zkoss.org/eval/org/zkoss/zk/zkwebfragment/| another artifact], so that you can decide to include it or not according to your requirement.
+
[[File:Paper-form.jpg|center]]
  
<!-- http://tracker.zkoss.org/browse/ZK-4022 -->
+
= Saves Signature Image =
  
 +
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]:
  
= Improved Rendering Speed =
+
<source lang="xml">
We improve the rendering speed when opening a tree node and a model change of a chosenbox.
+
<signature onSave="image.setContent(event.getMedia())"/>
<!--
+
<image id="image"/>
http://tracker.zkoss.org/browse/ZK-3978
+
</source>
http://tracker.zkoss.org/browse/ZK-3986
 
-->
 
  
= Summary =
+
== File Size Limit ==  
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!
+
If you see <code>SizeLimitExceededException</code>, you can adjust max uploading file size by
<br />
+
[[ZK_Configuration_Reference/zk.xml/The_system-config_Element/The_max-upload-size_Element | file-size-threshold]].
<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.