0

How to set the background image to Button component?

asked 2010-04-08 10:01:04 +0800

baskaraninfo gravatar image baskaraninfo
536 2 2 9

I have been able to set the foreground image using image property in button component as follows:
<button image="source file name.png" />

But, I can't able to set the background image for the button.

Any help will be appreciated.

Thank you.

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2010-04-08 19:40:48 +0800

samchuang gravatar image samchuang
4084 4

Hi

you could refer to style guide

link publish delete flag offensive edit

answered 2010-04-14 17:32:56 +0800

twiegand gravatar image twiegand
1807 3

The may not be the most elegant way to do this but it works for me:

<zk>
<style>
.z-button .z-button-tl, .z-button .z-button-tr, .z-button .z-button-bl, .z-button .z-button-br,
.z-button .z-button-tm, .z-button .z-button-bm, .z-button .z-button-cl, .z-button .z-button-cr {
background-image:none; background-color:#008bb6;
}

.z-button .z-button-cm {
background-image:none; background-color:#ff0000;
}
</style>

<window id="win" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" contentStyle="overflow: auto">
<button label = "Button Label"image="/images/calendar.png"/>
</window>
</zk>

Of course, you'll have to adjust the image path...

Hope that helps,

Todd

link publish delete flag offensive edit

answered 2010-04-15 01:31:40 +0800

baskaraninfo gravatar image baskaraninfo
536 2 2 9

Thank you samchuang & twiegand.

@twiegand
We can able to set the foreground image as you depicted but I had asked for the way to set the background image.

I had achieved it by replacing btn-ctr.gif inside zul.jar with our custom image.

Thank you.

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-04-08 10:01:04 +0800

Seen: 2,029 times

Last updated: Apr 15 '10

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