Friday, August 16, 2013

ZK Listbox MouseOver CSS Overriding or Remove Hover

See the below code for this.

Tuesday, August 13, 2013

ZK Application Performance Boosting Tips

1-Handling Huge data:-Use Model and Paging
2-Turn on ROD(Rendered on Demand feature) loads only the necessary chunk from associaed ListModel,item are olny created and sent to client when visible,Boost performance client side as well as server side,Less memory usage on Client side and server side

3-Implement OWN ListModel,TreeModel
Extends from AbstractListModel,AbstractTreeModel
ListModel ,DefaultTreeModel assumes all data is available in memory,however it is not pragmatic to load data at once
By implemeting custom model you can load only segment of data required and progressively allocate/de-allocate data
This furthers server side optimization of handling huge data in addition to ROD
Defer Creation of Child Components
Do not create Components unless you need them

Defer the rendering of child widgets
do not create delay creating rendering components in case you still need them
unlike fulfill components are created immediately only the rendering is delayed
Just a UX trick but is effective

Minimize # of JS files to load
Why?
More # of JS files means more # of Get Request
Why ZK doesnt budle all in one by default?
Not all required
Make payload that much bigger even of Simple pages
User server side include for all and only load single load this single page like this
Load JS And CSS resources from server nearby
Why?
Close so loads faster
Main Server load can be reduced
How?
HOST ZK static resource Server
Implement a Encodes.URLEncoder to serve the static resources JS & CSS from nearby Server
Use Stub only components to reduce the server memory footprint Why?
Each ZK Components has 2 Counterparts A widget, that represents it on browser side A Components , normally a Java Object instance, that holds component state Howe ever if you only need for layout of render particular info/data then you may not need it's Java object instance on server side
What about really truly huge data requirement?
Why?
Sometimes you just have to show hundreds of thousands of row/column data
and not use paging
ROD is not enough
For that Use BigListbox
How?
Just Like any other data Component
Use compiled Java Code,No Zscript
Reuse Desktop
Use only for pages that takes longer to generate
You could also employ time based strategy
Use button mold "os"
Use lighter components where possible eb Hlayout/vlayout instead of hbox/vbox
Detach and reattach instead of visible="false"
Note:- This all data from ZK Training session from Zk Team

Monday, August 5, 2013

How to replace to ZScript code from Production Ready code from JavaScript :ZK

Today i am going to discuss about a very good think how we can replace Zscript use from production server , as it is my personal experience when i have any issue in zk and i asked something in ZK forum or Stackoverflow i found many times people answer with Zscript may be because its easy to write and run very easily .
But what will happen when we have Zscript disable in our Zk project something like this in zk.xml file
Also in somewhere in Zk Document, i already read that Zscript not for production server its only for testing purpose so never use ZScript in production code.
Let me explain the issue and solution in briefly few week back i have wrote about ZK+RapidSpell Checker integration but that example not working when zul have parent-child relationship like if zul is part of tabs and tabs are part of index.zul so index.zul is parent of all the zul
So i have to ask this question in Stackoverflow and as expected i got the help from two guys @benbai and @Jim but i saw solution was on Zscript again its a problem for me because as i already mentioned above i can not use Zscript so what the solution how to ignore Zscript code ?
Here is the Zscript code with solution

And i have to use this code and it replaces Zscript code with JavaScript

So this is one way to do this and ignore using Zscript.