The Difference Between XUL and XHTML Components"

From Documentation
m
Line 17: Line 17:
  
 
<source lang="java">
 
<source lang="java">
new Raw().setDynamicAttribute("align", "top");
+
new Raw("marquee").setDynamicAttribute("align", "top");
 
</source>
 
</source>

Revision as of 03:52, 20 May 2010

All XHTML components are derived from AbstractTag.

An XHTML component is a thin wrapper that encapsulates a native HTML tag. It is different to a XUL component or other none-native component in several ways.

  • By implementing the RawId interface, the universal identifier, getUuid, is the same as the identifier getId.
  • By implementing the DynamicAttributes interface, all XHTML components support arbitrary attributes. In other words, any attribute name is legal (as long as the targeted browser supports).

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");