0

Need to create Tabs Dynamically

asked 2010-02-11 03:31:24 +0800

supreeth106 gravatar image supreeth106
6

Hi I am really new to ZK...I need to create Tabs dynamically...for example if an admin logs in, certain tabs hav to b displayed which cannot b displayed to ordinary users....

delete flag offensive retag edit

5 Replies

Sort by ยป oldest newest

answered 2010-02-11 08:57:09 +0800

YamilBracho gravatar image YamilBracho
1722 2

I think it is easier to have all the tabs you need and hide the ones according the user logged in...

link publish delete flag offensive edit

answered 2010-02-11 14:44:06 +0800

balamurugan32000 gravatar image balamurugan32000
111 2

<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<window title="Tab Sample" border="normal">
<tabbox>
<tabs>
<tab label="" />
<tab label="" if="1==2" />
</tabs>
<tabpanels>
<tabpanel></tabpanel>
<tabpanel if="1==2" >
</tabpanel>
</tabpanels>
</tabbox>
</window>
</zk>

So the tab are not Created if the user is not administrator and no zk components inside that tab is created.

link publish delete flag offensive edit

answered 2010-02-14 22:55:07 +0800

supreeth106 gravatar image supreeth106
6

hi bala..cud u explain this a lil bit...

link publish delete flag offensive edit

answered 2010-02-17 12:38:26 +0800

balamurugan32000 gravatar image balamurugan32000
111 2

before creating the component zk will verify the if and unless conditions if exist. i.e., if you have "if" or "unless" condition in the code, then before creating the component it gets evaluated. it is similar to

<zk: if = "1==2">
<tabpanel />
</zk>

So only if the condition is successful, the below code gets executed.

link publish delete flag offensive edit

answered 2010-02-17 13:11:42 +0800

dhamu gravatar image dhamu
165 1 6

I disagree with the recommendation given. I think that you would be best off to use <zscript> to create the tabs dynamically at first and then you may decide that you prefer to use Java to extend the tab object to include the functionality that you desire. However, this will require you to become more familiar with the zul class hierarchy and API. It may sound like a lot of work, but it's hugely beneficial to know it if you are going to be working with ZK on a regular basis.

Dave

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2010-02-11 03:31:24 +0800

Seen: 721 times

Last updated: Feb 17 '10

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More