0

tabs and forEach

asked 2006-05-02 21:08:12 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3711137

By: gladiator

does forEach work with tab?
I tried the following code, it doesn't work. any suggestion is appreciated.

<zk>
<zscript>
String[] menu={"A","B"};
</zscript>
<window border="normal">
<tabbox width="200px" mold="accordion" >
<tabs forEach="${menu}">
<tab label="${each}" />

</tabs>

</tabbox>

</window>
</zk>

delete flag offensive retag edit

6 Replies

Sort by ยป oldest newest

answered 2006-05-03 02:15:23 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3711415

By: tomyeh

Put forEach at the component that needs to be generated multiple times (not its parent):

<tabs>
<tab label="${each}" forEach="${menu}"/>


link publish delete flag offensive edit

answered 2006-05-03 03:06:41 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3711446

By: henrichen

And if you need to generate tabpanels, too.

<zk>
<zscript>
String[] menu={"A","B"};
</zscript>
<window border="normal">
<tabbox width="200px" >
<tabs >
<tab label="${each}" forEach="${menu}"/>
</tabs>
<tabpanels>
<tabpanel forEach="${menu}">${each}</tabpanel>
</tabpanels>
</tabbox>
</window>
</zk>

/henri

link publish delete flag offensive edit

answered 2006-05-03 19:23:17 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3712707

By: gladiator

And what if I want to reference the tab that the user clicks on? in the following example? I want to get access to the index of the tab that the user clicks on in the function loadContent(). is this possible?
thanks

<tabbox width="200px" mold="accordion" onSelect="loadContent()">
<tabs >
<tab label="${each}" forEach="${menu}" />

</tabs>

</tabbox>

link publish delete flag offensive edit

answered 2006-05-03 19:36:01 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3712724

By: gladiator

ok I got it. you use self.getSelectedIndex to get the index.

link publish delete flag offensive edit

answered 2006-05-05 22:25:56 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3716257

By: gladiator

is it possible to have tabs in the following layout?
have them stacked horizontalled and vertically.

tab1 | tab2 |tab3
tab4 | tab5 |tab6
-----------------
tab panel |
|
------------------

link publish delete flag offensive edit

answered 2006-05-06 04:18:28 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3716498

By: henrichen

Please post that to Feature-Request, so we can track it.

/henri

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: 2006-05-02 21:08:12 +0800

Seen: 364 times

Last updated: May 06 '06

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