New Features of ZK 9.5.0"
Line 47: | Line 47: | ||
= Data Binding Syntax Sugar = | = Data Binding Syntax Sugar = | ||
− | ZK | + | ZK now provides a simplified syntax with a built-in convention. You can type fewer characters when applying data binding and speed up your development. |
Line 61: | Line 61: | ||
</source> | </source> | ||
− | + | It also saves you some effort when using property binding. | |
− | |||
<source lang='xml'> | <source lang='xml'> | ||
<!-- original syntax --> | <!-- original syntax --> | ||
− | <label value="@load(vm. | + | <label value="@load(vm.name)"/> |
<!-- new syntax --> | <!-- new syntax --> | ||
− | <label value="@load( | + | <label value="@load(name)"/> |
</source> | </source> | ||
Line 86: | Line 85: | ||
Now ZK will create a command binding at an event attribute (starting with '''on''') by default without specify <tt>command</tt> explicitly. | Now ZK will create a command binding at an event attribute (starting with '''on''') by default without specify <tt>command</tt> explicitly. | ||
<source lang='xml'> | <source lang='xml'> | ||
− | @ | + | <!-- original syntax --> |
+ | <button onClick="@command('hello')"/> | ||
+ | |||
+ | <!-- new syntax --> | ||
+ | <button onClick="@('hello')"/> | ||
+ | </source> | ||
+ | |||
+ | |||
+ | ==Command Binding Parameter Inference== | ||
+ | When passing parameters to a command method, you don't need to specify a key now. ZK can infer each parameter according to its order. | ||
+ | <source lang='xml'> | ||
+ | <!-- original syntax --> | ||
+ | <button onClick="@command('hello')"/> | ||
+ | |||
+ | <!-- new syntax --> | ||
+ | <button onClick="@('hello')"/> | ||
</source> | </source> | ||
Revision as of 10:40, 21 September 2020
Hawk Chen, Engineer, Potix Corporation
Sep. 22, 2020
ZK 9.5.0
Introduction
In ZK 9.5, we focus on User Experience and Developer Experience. Therefore, we pay lots of effort to make components
Download
Web Accessibility Support
We are excited to announce a preview version of the za11y (ZK Accessibility) package for WCAG 2 compliance. Various enhancements have been made on ZK components for keyboard interaction (focus, navigation order, …) and screen reader support (aria-labels, roles, …). In addition, accessibility-ready themes are made available for providing sufficient color contrast and focus style.
Check out the ZA11Y Demo Project.
Learn more about ZK Accessibility and WCAG themes.
Components
Data Binding Syntax Sugar
ZK now provides a simplified syntax with a built-in convention. You can type fewer characters when applying data binding and speed up your development.
Default ViewModel ID
Default ViewModel ID is vm without explicitly specified.
<!-- original syntax -->
<div viewModel="@id('vm') @init('MyViewModel')" >
<!-- new syntax -->
<div viewModel="@('MyViewModel')">
It also saves you some effort when using property binding.
<!-- original syntax -->
<label value="@load(vm.name)"/>
<!-- new syntax -->
<label value="@load(name)"/>
Implicit Init Binding
Now you can apply an init property binding without specifying "init".
<!-- original syntax -->
<label value="@init(vm.greeting)"/>
<!-- new syntax -->
<label value="@(greeting)"/>
Implicit Command Binding
Now ZK will create a command binding at an event attribute (starting with on) by default without specify command explicitly.
<!-- original syntax -->
<button onClick="@command('hello')"/>
<!-- new syntax -->
<button onClick="@('hello')"/>
Command Binding Parameter Inference
When passing parameters to a command method, you don't need to specify a key now. ZK can infer each parameter according to its order.
<!-- original syntax -->
<button onClick="@command('hello')"/>
<!-- new syntax -->
<button onClick="@('hello')"/>
Theme Template Supports Compact Themes
ZK Theme Template provides an easy way for theme customization. It is now updated to support compact themes — you can now customize a compact theme (ex. iceblue_c) as easy as the standard themes, and upgrade the theme easily when you upgrade your ZK version.
Backward Compatibility: ZK 7 Form Binding
In ZK 8 a new MVVM form binding was introduced which made it difficult for ZK 7 projects to upgrade. In ZK 9.5 we have now ported back ZK 7’s simple form binding. If you have ZK 7 projects that use the legacy simple form binding, you can easily upgrade to ZK 9.5 with minimum code changes.
AJAX/WebSocket
[ZK-4175] - replace XHR with the fetch() API to allow SSO redirect handling [ZK-4451] - iOS 13 cause iPad to set "request desktop mode" for all website by default [ZK-4530] - Provide a "heart beat"/"ping pong" mechanism for websocket connections [ZK-4546] - Caching of EL method invocations [ZK-4562] - Introduce OWASP Dependency-Check
Introducing fetch( ) API for Redirection/SSO handling
Redirects (HTTP 302) including SSO handling has always been a common challenge in Ajax. In 9.5 the fetch( ) API is used instead of XHR allowing better redirect handling.
iOS13 support
Apple has changed the implementation and now an iOS13 device no longer identifies itself with the iOS Safari User Agent (UA) string, but with the MacOS Safari one instead. Corresponding changes have been made in ZK 9.5 to ensure ZK detects the devices correctly.
Comments
Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License. |