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 />

application/vnd.mozilla.xul-xml<br />

<br />

<br />

zhtml<br />

text/html<br />

<br />

<br />

zip<br />

application/x-zip<br />

<br />

<br />

zul<br />

text/html<br />

<br />

<br />

index.zul<br />

index.zhtml<br />

index.html<br />

index.htm<br />

<br />

<br />

If we want to provide just a new mold to a component, it's possible to<br />

declare a mold-uri in the component tag. A new mold means a new<br />

.dsp file.<br />

Summary<br />

In this chapter, we have learned how to customize existing components. We have<br />

the ability to use styles which are known from HTML to change the layout of the<br />

components. Additionally we have seen that it is possible to build new components<br />

(macro components) on the basis of existing components. And last but not least, in<br />

the last section of this chapter we have learned how to create a complete custom<br />

component that is based on a .dsp file.<br />

Our advice is first to try to build on an existing component, instead of creating<br />

a complete component of your own. Use object-oriented inheritance, not code<br />

duplication, which would loose advantage of error corrections in newer versions.<br />

[ 154 ]

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

Saved successfully!

Ooh no, something went wrong!