Wednesday, May 29, 2013

ZK Pass argument from ZUL page to ViewModel Class

Today i was looking on the ZK Forum and i saw someone have issue to pass argument from ZUL page to a ViewModel method here i am giving a example for that ,Let us suppose you want to pass instance from ZUL to a method you can code like this..

And the action method in View Model class
For more information you can check this question Pass argument in ZK Zul page to ViewModel class

Monday, May 27, 2013

ZK Textbox color change

Here i am putting a scenario let us suppose we have a zk textbox and some condition i want the inner color of zk textbox would be differ than the default one(White).How can i create a textbox with some new color inside it? As we know we can extend the ZK components very easily ,to extend any component in Zk what we have to do?
1-Add this entry in lang-addon.xml file...Here we are using textbox so we have to extend ZK textbox.

Here you can see we have component-class so we have to create this class in our project and the contain of this class would be

Here you can see we have all logic inside set method of mandatory variable where i am set the style class for some condition like if mandatory varaible is true then style class would be textbox-color otherwise it would be textbox-non-mandatory-color and these style class would contain ...

Now one question in your mind where we have to put these classes so that out java class file will able o read these files .We can put all our style classes into zk.xml file, let us suppose we have myStyle.css file you have to below entry in the zk.xml file

Now how can we use it in zul

Now it will change the zk textbox color according to mandatory field value.

Tuesday, May 21, 2013

ZK Upload a image or Image binding In MVVM Architecture

The ZUL file code for this will be
and in you View Model class you have to use this code snap..
I have used image tab only for showing a uploading image if you want to upload the image only you do not need to use the image tag in the page.
Note:- I have removed unwanted line of code so may be code will be not compile but this is a way to work with image.You can made changes in code according to your requirements.
The detail method of showInfo()

Monday, May 20, 2013

ZK Mathematical Calculattion in ZUL page

Today blog entry dedicated to the mathematical calculation inside ZUl page itself...
And View Model will be ...
And Bean class

Note:-This example provided by ZK Team developer @BenBai

Friday, May 17, 2013

ZK Combobox With Item rendered

Please follow my previous Post and if you want to add rendered zk combobox with the help of Item rendered then you can use below code. Java Code for this
And the ZUl code for this..

ZK Combobox With SelectOption

First thing you need to creation a SelectOption class..
Now in your view model create these variables with get and set method ..
And in your zul file

This Post is related with ZK Forum this questionZK MVVM Combox box Data binding

Wednesday, May 1, 2013

How to enable or disable Zscript in ZK Framework.

As in production server we do not want to use Zscript ,so ZK already given flexibility to disable to enable the zscript feature of ZK.What you have to do just make below entry in zk.xml file.