In Pure Java"

From Documentation
m (Created page with 'It is also possible to create XHTML components in Java. The XHTML components are mapped to classes by ZK which means you can implement something like this: <source lang="java"> …')
 
m
Line 5: Line 5:
 
</source>
 
</source>
  
This enables you to use XHTML components from ZUL or within Java just like anything ZK related. Next let’s explore the different between using XUL components and XTML components.
+
This enables you to use XHTML components from ZUL or within Java just like anything ZK related. If you need to output an XHTML component which is not present in ZK you can use the Raw object.
 +
 
 +
=== Raw ===
 +
 
 +
A special component, <javadoc>org.zkoss.zhtml.Raw</javadoc> is used to represent any component that is not declared in the following section (i.e., not in lang.xml). In other words, if any unrecognized component name is found, an instance of <javadoc>org.zkoss.zhtml.Raw</javadoc> is created and a proper HTML tag will be generated accordingly. In other words, any component name is legal as long as the targeted browser supports.
 +
 
 +
<source lang="xml" >
 +
<marquee align="top">...</marquee>
 +
</source>
 +
 
 +
is equivalent to
 +
 
 +
<source lang="java">
 +
new Raw("marquee").setDynamicAttribute("align", "top");
 +
</source>
 +
 
 +
Next let's investigate the differences between XUL and XHTML components.

Revision as of 03:55, 20 May 2010

It is also possible to create XHTML components in Java. The XHTML components are mapped to classes by ZK which means you can implement something like this:

Td myTd = new Td();

This enables you to use XHTML components from ZUL or within Java just like anything ZK related. If you need to output an XHTML component which is not present in ZK you can use the Raw object.

Raw

A special component, Raw is used to represent any component that is not declared in the following section (i.e., not in lang.xml). In other words, if any unrecognized component name is found, an instance of Raw is created and a proper HTML tag will be generated accordingly. In other words, any component name is legal as long as the targeted browser supports.

<marquee align="top">...</marquee>

is equivalent to

new Raw("marquee").setDynamicAttribute("align", "top");

Next let's investigate the differences between XUL and XHTML components.