How to tie zk components to objects or variables?

798 views Asked by At

Say I have a zul page like so:

<zk>
<tree id="tree1">
<tree id="tree2">
</zk>

I need to create an object which can be set to different zk components depending on conditions. The conditions could be events, for example:

If a treerow of tree1 is clicked ---> set the value of object to tree1 --> then I should be able to access the object i.e. tree1 from multiple java classes and modify it If a treerow of tree2 is clicked ---> set the value of object to tree1 --> then I should be able to access the object i.e. tree1 from multiple java classes and modify it

What is the best approach to achieve this task? Maybe I can set an object in Desktop and use it, but I am not sure how to do this. Can someone point me to suitable documentation or examples?

Thanks, Sony

1

There are 1 answers

0
TonyQ On BEST ANSWER

Reference to ZK document Inter-Page_Communication .

You could use setAttribute / getAttribute to share datas , it's available for all components and desktops.