0

split label of button on 2 lines

asked 2012-06-27 15:39:51 +0800

VincenzoDC gravatar image VincenzoDC
30

I have this problem on button style.
i need that a label of button is splitted on two line, like this
"SEND TO
ANOTHER PAGE"
for visual reason, i have more buttons and all buttons should have same size.
I try to set widt in this way:
<button id="sendOut" label="Send to another page" width="80px" sclass="text3strong" />
but the size of button is the same if i put 80px or 10px in width property .
i try to insert \n in labe, like this:
sendOut.setLabel("Send to"+"\n"+" another page" )
but i have always the same result.
where do i wrong? how do i resize the button width?
thanks all.

delete flag offensive retag edit

5 Replies

Sort by ยป oldest newest

answered 2012-06-27 18:20:30 +0800

jj gravatar image jj
638 3

I am not sure it is possible to have multi-line buttons other than set the width correctly and the label breaks off at the right place.

There may be a way around this:

style a <label> appropriately to look like a button, and use the multiline feature of the label. (note: use instead of \n, since it is xml).

hope it helps.

-JJ

link publish delete flag offensive edit

answered 2012-06-28 07:43:40 +0800

Bobzk gravatar image Bobzk
444 1 8

try

	<label multiline="true">line 1
	                        line 2
        </label>

link publish delete flag offensive edit

answered 2012-06-29 07:22:44 +0800

VincenzoDC gravatar image VincenzoDC
30

thank u for your advice, but there are too difficult,
but i ask why don't zk respect the width of button that i set?
Bobzk i don't understand if you say to insert label into button tags or use label to fire event to manage

thanks guys

link publish delete flag offensive edit

answered 2012-06-29 17:37:17 +0800

jj gravatar image jj
638 3

I think it may have something to do what is in your sclass. If you remove that, I am sure the width you specified will take effect.

link publish delete flag offensive edit

answered 2012-07-06 01:20:05 +0800

vincentjian gravatar image vincentjian
2245 6

Hi VincenzoDC,

You have to override default button style as follows:

<zk>
    <style>
        .z-button .z-button-cm { white-space: normal; }
    </style>
    <button id="sendOut" label="Send to another page" width="80px" sclass="text3strong" />
</zk>

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-06-27 15:39:51 +0800

Seen: 239 times

Last updated: Jul 06 '12

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