0

Tab panels: Adding common message in all tab panels

asked 2012-03-07 19:18:55 +0800

vsony7 gravatar image vsony7
102 1

updated 2012-03-07 19:19:41 +0800

Hi,

Is there a way to add a common message at the beginning of all tab panels inside a tabbox? In my code below, I am adding a Welcome message in each tab panel. I am doing the same action three times

Is there a way to add a header message inside the "Tabpanels" component which can then be applied to all tabpanels rather than adding the same message in each "Tabpanel" component. I would like to add such messages dynamically in multiple tab panels, so it would be nice if I could add a common message at one place.

<tabbox id="tb" height="300px">
    <tabs id="tabs">
        <tab id="A" label="Tab A" ></tab>
        <tab id="B" label="Tab B" ></tab>
        <tab id="C" label="Tab C" ></tab>
    </tabs>
    <tabpanels>
        <tabpanel>Welcome</tabpanel>
        <tabpanel>Welcome</tabpanel>
        <tabpanel>Welcome</tabpanel>
    </tabpanels>
</tabbox>

Thanks,
Sony

delete flag offensive retag edit

3 Replies

Sort by » oldest newest

answered 2012-03-07 19:57:53 +0800

twiegand gravatar image twiegand
1807 3

updated 2012-03-07 19:58:54 +0800

vsony7,

If the message is static, why not use EL to do it?  Here is a modification to your example:

<zk>
	<zscript>
		public String tabWelcomeMsg = new String("Hello and Welcome");
	</zscript>
	<window>
		<tabbox id="tb" height="300px">
			<tabs id="tabs">
				<tab id="A" label="Tab A"></tab>
				<tab id="B" label="Tab B"></tab>
				<tab id="C" label="Tab C"></tab>
			</tabs>
			<tabpanels>
				<tabpanel><label value="${tabWelcomeMsg}"/></tabpanel>
				<tabpanel><label value="${tabWelcomeMsg}"/></tabpanel>
				<tabpanel><label value="${tabWelcomeMsg}"/></tabpanel>
			</tabpanels>
		</tabbox>
	</window>
</zk>

If not static, you could always use databinding.

Hope that helps,

Todd

link publish delete flag offensive edit

answered 2012-03-14 20:28:51 +0800

vsony7 gravatar image vsony7
102 1

The idea is to add an error message in all tab panels. Say, I add a new tabpanel in my tabbox in future, I will have to add "<label value="${tabWelcomeMsg}"/>" in the new tabpanel as well. Ofcourse, it is not a show stopper and I can do that but I was wondering if there was a simpler way to add a component like a hbox common to all tabpanels? See my pseudo code below:

<tabpanels>
   <hbox> Some error/warning/information message goes here </hbox>
   <tabpanel> Panel 1 </tabpanel>
   <tabpanel> Panel 2 </tabpanel>
  ....
</tabpanels>

link publish delete flag offensive edit

answered 2012-10-04 06:45:17 +0800

caesru gravatar image caesru
6

hi, help me, i need do tabbox dynamic , the date from database, i am sorry my ingles

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: 2012-03-07 19:18:55 +0800

Seen: 778 times

Last updated: Oct 04 '12

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