23.12.2012 Views

ZK Developer's Guide

ZK Developer's Guide

ZK Developer's Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Creating Custom Components<br />

The result is shown as follows:.<br />

Another solution for defining the layout of a control is to externalize the style<br />

definition (instead of using the style attribute). With this solution, we have the<br />

benefit of being able to reuse the style definition. The definitions from the external<br />

stylesheet could be used with the sclass attribute.<br />

<br />

To provide the definition, we can either embed the style directly into the ZUL page,<br />

or include an external CSS file.<br />

External variant:<br />

<br />

.simplelabel<br />

{<br />

padding:2px;<br />

color: black;<br />

font-weight:bold;<br />

}<br />

The mentioned path (/css/sample-styles.css) is relative to the web application.<br />

Embedded variant:<br />

<br />

mylabel<br />

{<br />

padding:2px;<br />

color: black;<br />

font-weight:bold;<br />

}<br />

<br />

[ 140 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!