New Features of ZK 9.6.0
Hawk Chen, Engineer, Potix Corporation
Aug. 10, 2021
From JDK 5 to JDK 17; from Spring, SpringMVC to SpringBoot; from Java EE to Jakarta EE. At ZK, we continue to grow with the Java ecosystem and broaden our reach for satisfying all walks of use cases and scenarios.
In ZK 9.6, a JakartaEE-compatible package is released along with the current JavaEE-compatible package, supporting you to either stay or migrate to Jakarta. With the upgraded ZK embed API, using ZK components, modules, and applications in combination with a 3rd party framework such as AngularJS and Python has become easier than ever. Finally, with your real-world feedback, we are thrilled to see WCAG-compatible ZK applications in service and reaching out to the unreached.
We are proud to announce ZK 9.6.
Jakarta EE Support
Starting from Jakarta EE 9, the javax.* namespace is renamed to jakarta.*. This means that in order to use Jakarta EE 9 and future versions, all applications, services and web containers previously depending on Java EE need to support the Jakarta namespace.
Since ZK 9.6, we start to support both the current Java EE and the Jakarta EE by providing two separate sets of artifacts. If you are migrating to Jakarta EE 9 you will need to include the Jakarta-compatible version of ZK:
<dependency> <groupId>org.zkoss.zk</groupId> <artifactId>zkmax</artifactId> <version>9.6.0-jakarta</version> </dependency>
Note that if you have not yet migrated to Jakarata EE and are staying in Java EE, you DO NOT need to specify the jakarta postfix. You should still specify 9.6.0 as your version number.
For non-maven users, two separate sets of binary files are provided, for example zkee-bin-eval-9.6.0-jakarta.zip and zkee-bin-eval-9.6.0.zip. Please download the file that matches your setup.
Multiple-Eras Calendar System
Datebox now supports Multiple-Eras Calendar systems e.g. Taiwan's ROC (Minguo), Japanese Eras and Thai Buddhist Eras. This can be done by specifying different locale value:
Read ZK_Component_Reference/Input/Datebox#Era_Calendar for details.
Grid/Listbox/Tree Supports Sticky Headers
You can now add a <sclass> to enable sticky header for Grid, Listbox and Tree. With sticky headers, when you scroll down a page where the Grid's header becomes out of the visible range in a viewport, the header will be floating and sticky on the top of the page. This feature is especially helpful for mobile device users.
Read ZK_Component_Reference/Data/Grid#Sticky_Header for details.
ListModelList (Map/Set/Array) Supports Form binding
From now on, when you use form binding proxy object ZK will also create a proxy for ListModelList, ListModelMap, ListModelSet, ListModelArray. This allows you to use form binding in a wider range of use cases. For example:
<grid form="@id('fx') @load(vm.property)" model="@init(fx.listModel)"> ... </grid>
Improved ZK Embedded Support for 3rd Party Integration
Embedding ZK application into a non-ZK application (ex. AngularJS, NodeJS, Python) is a powerful way to leverage ZK's components and workflows in a larger and sophisticated user interface. The embedding process relies on multiple mechanisms such as CORS, framework interactions, and ZK workflows.
Please refer to ZK Developer's Reference for details.
In ZK 9.5 we released the preview version of the za11y (ZK Accessibility) package for WCAG 2 AA compliance. Now, thanks to everyone who shared with us your testing result and real-life feedback, we were able to integrate your feedback and make further improvements and now we believe we have reached a well functional state.
Major WCAG enhancements done in 9.6 includes allow to focus any components,buttons in a caption, listbox/tree focus lost problem, borderlayout keyboard resizing movement speed, button stealing focus problems, and cancel in keyboard for colorbox.
Block all user keyboard input when showing the processing mask
Previously, when ZK shows the "processing" mask or when
Clients.showBusy() is called, ZK only blocks mouse clicking. From 9.6, it will also block all user keyboard input. This eliminates the risk of having a user accidentally pressing a key to duplicate an operation.
Sort a ListModel in MVVM pattern
Previously, the only way to re-sort a
Listbox with the built-in comparator is to call
Listheader.sort(). In ZK 9.6 we added the MVVM support, you can now call
sort() on all classes that implement Sortable to sort with the built-in comparators under the MVVM pattern in a more clean and consistent way.
Please refer to ZK Configuration Reference for details.
Tree component supports select-all
A select-all checkbox is added to the header allowing users to select all items.
Stronger security for CSRF token with cryptographically random desktop ID generator
In this version, ZK adopts a new default desktop ID generator which uses a cryptographically stronger pseudo-random number generator to generate 128 random bits (16 bytes) for improved security.
This feature is enabled by default. However if your testing application relies on the previous Desktop ID generator and you wish to use the old generator, specify below in zk.xml
<system-config> <id-generator-class>org.zkoss.zk.ui.impl.LegacyDesktopIdGenerator</id-generator-class> </system-config>
When migrating to Jakarta EE, in addition to choosing the Jakarta-compatible core ZK package, if you are using the following add-ons and extension, you will need to use the Jakarta-compatible versions:
- ZATS Testing (ZATS 3 for JavaEE; ZATS 4 for JakartaEE)
- ZK CKEditor (Jakarta variant available since 188.8.131.52)
- ZK Spring (wait for Spring Framework to support Jakarta)
- ZK SpringBoot (wait for Spring Framework to support Jakarta)
More Upgrade Notes
- The transitive dependency of jasperreports was removed in zkex. If you want to use jasperreports, please include it manually.
- Deprecated isEditionValid() and encodeWithZK() of org.zkoss.zk.fn.ZkFns and core.dsp.tld.
- Since 9.6, Datebox format with a single y pattern letter will not be truncated to 2 digits year according to the Unicode specification.
- For more details, please refer to release note.
Discontinued Browser Support
- ZK is planning to discontinue the support for IE9, IE10 and legacy Edge starting from the next major version ZK 10 in 2022. If you require additional information please contact us at firstname.lastname@example.org.
|Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.|