0

Change font-size from tabbox

asked 2011-05-04 15:05:38 +0800

andij62 gravatar image andij62
301 1 7

Hallo all,

i will change the font-size from tabs with jave code because i render the font-size variabel about "onClientInfo" is fired.

in zul-File no problem with

<style>
.z-tab-accordion-text { 
	font-size: 20px; 
}
</style>

please can everyone give me a java-sample.

Best Regards
Andi

delete flag offensive retag edit

12 Replies

Sort by ยป oldest newest

answered 2011-05-04 19:13:35 +0800

wrt2k4 gravatar image wrt2k4
24

Component.setStyle("font-size: 20px;");

link publish delete flag offensive edit

answered 2011-05-05 06:27:05 +0800

andij62 gravatar image andij62
301 1 7

Hi,

thanks for your sample but it doesn't work! I use 5.0.6 CE.

any other idea?

link publish delete flag offensive edit

answered 2011-05-05 07:01:14 +0800

tawa gravatar image tawa
162 1

Hi,
have a look into the style guide:
http://books.zkoss.org/wiki/ZK%20Style%20Guide/XUL%20Component%20Specification/Tabbox

link publish delete flag offensive edit

answered 2011-05-05 10:57:43 +0800

andij62 gravatar image andij62
301 1 7

Hi tawa,

the style is not the problem, see my first message! The Problem is how set the style direct in java!

link publish delete flag offensive edit

answered 2011-05-06 01:41:06 +0800

andij62 gravatar image andij62
301 1 7

please, can everyone help me und give me a sample in java!

Best Regards
Andi

link publish delete flag offensive edit

answered 2011-05-06 01:51:09 +0800

tawa gravatar image tawa
162 1

Hi,
maybe this will help you:
http://www.zkoss.org/forum/listComment/14651

link publish delete flag offensive edit

answered 2011-05-06 06:28:48 +0800

andij62 gravatar image andij62
301 1 7
Hi tawa, this does not help! I will change the font-size dynamic in java but it doesnt work! Where is the error?
<zk>  
<style dynamic="true">
.z-tab-accordion-text { 
	color:blue; 
}
</style>
  <tabbox id="tabbox" >
    <tabs>
      <tab id="tab1" label="Tab 1" /> 
      <tab id="tab2" label="Tab 2" /> 
    </tabs>
    <tabpanels>
      <tabpanel>
        <label value="Content for Tab #1"/>
      </tabpanel>
      <tabpanel>
        <label value="Content for Tab #2"/>
      </tabpanel>
    </tabpanels>
  </tabbox>
</zk>
	public void onClientInfo(ClientInfoEvent event) throws Exception {
		deskWidth = event.getDesktopWidth();
		deskHeight = event.getDesktopHeight();

		tab1.setStyle("font-size: " + Integer.toString((int) (deskHeight / 25)) + "px");
...
...
...
Best regards
link publish delete flag offensive edit

answered 2011-05-06 07:38:50 +0800

tawa gravatar image tawa
162 1

hi,

the Component.setStyle("font-size: 20px;"); method work for other components e.g. a label.
I tested a tab and a label component with firebug and i think the style is set to a wrong html tag if tab is used.
so i think it is a bug.

link publish delete flag offensive edit

answered 2011-05-06 07:42:55 +0800

tawa gravatar image tawa
162 1

the font style is set in the <li> tag, but i think it must be set in the <span> tag.

<li id="g4JQc" class="z-tab z-tab-seld" style="font-size: 20px;">
<div id="g4JQc-hl" class="z-tab-hl">
<div id="g4JQc-hr" class="z-tab-hr">
<div id="g4JQc-hm" class="z-tab-hm ">
<span class="z-tab-text">TEST1</span>
</div>
</div>
</div>
</li>

link publish delete flag offensive edit

answered 2011-05-07 13:48:20 +0800

andij62 gravatar image andij62
301 1 7

ok its possible and now what can i do that the bug is fixed? Its a important function for me!

best regards

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: 2011-05-04 15:05:38 +0800

Seen: 941 times

Last updated: May 16 '11

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