Html"

From Documentation
m
Line 3: Line 3:
 
= Html =
 
= Html =
  
*Demonstration: N/A
+
*Demonstration: [http://www.zkoss.org/zkdemo/composite/html_element Html]
 
*Java API: <javadoc>org.zkoss.zul.Html</javadoc>
 
*Java API: <javadoc>org.zkoss.zul.Html</javadoc>
 
*JavaScript API: <javadoc directory="jsdoc">zul.wgt.Html</javadoc>
 
*JavaScript API: <javadoc directory="jsdoc">zul.wgt.Html</javadoc>
 +
*Style Guide: N/A
  
 
= Employment/Purpose =
 
= Employment/Purpose =
Line 16: Line 17:
  
 
<source lang="xml" >
 
<source lang="xml" >
  <window id="win" title="Html Demo">
+
  <window id="win" title="Html Demo" border="normal">
 
     <html><![CDATA[
 
     <html><![CDATA[
 
         <h4>Hi, ${win.title}</h4>
 
         <h4>Hi, ${win.title}</h4>
Line 35: Line 36:
 
</source>
 
</source>
  
=Supported events=
+
=Supported Events=
  
 
{| border="1" | width="100%"
 
{| border="1" | width="100%"
Line 44: Line 45:
 
| None
 
| None
 
|}
 
|}
 
+
*Inherited Supported Events: [[ZK_Component_Reference/Base_Components/XulElement#Supported_Events | XulElement]]
See also events inherited from [[ZK Component Reference/Base Components/XulElement#Supported_events | XulElement's Supported Events]].
 
  
 
=Supported Children=
 
=Supported Children=
  
  *ALL
+
  *None
  
=Use cases=
+
=Use Cases=
  
 
{| border='1px' | width="100%"
 
{| border='1px' | width="100%"
Line 70: Line 70:
  
 
=Version History=
 
=Version History=
 
+
{{LastUpdated}}
 
{| border='1px' | width="100%"
 
{| border='1px' | width="100%"
 
! Version !! Date !! Content
 
! Version !! Date !! Content

Revision as of 09:21, 18 November 2010

Html

  • Demonstration: Html
  • Java API: Html
  • JavaScript API: Html
  • Style Guide: N/A

Employment/Purpose

The simplest way is to use a XUL component called html to embed whatever HTML tags you want to send directly to the browser. To avoid ZK from interpreting the HTML tags, you usually enclose them with <![CDATA[ and ]]>. In other words, they are not the child component. Rather, they are stored in the content property. Notice you can use EL expressions in it.

Example

ZKComRef Html.png

 <window id="win" title="Html Demo" border="normal">
     <html><![CDATA[
         <h4>Hi, ${win.title}</h4>
         <p>It is the content of the html component.</p>
     ]]></html>
 </window>

where <h4>...</p> will become the content of the html element (see also the getContent method of the org.zkoss.zul.Html class).

The html component generates the HTML SPAN tag to enclose the content. In other words, it generates the following HTML tags when rendered to the browser.

 <span id=”...”>
     <h4>Hi, Html Demo</h4>
     <p>It is the content of the html component.</p>
 </span>

Supported Events

Name
Event Type
None None

Supported Children

*None

Use Cases

Version Description Example Location
3.6 Work with HTML tags: The Html component http://docs.zkoss.org/wiki/Work_with_HTML_Tags#The_html_Component
3.6 herf attribute in Html component http://www.zkoss.org/forum/listComment/4745
3.6 Use Html component to escape HTML characters http://www.zkoss.org/forum/listComment/11118

Version History

Last Update : 2010/11/18


Version Date Content
     



Last Update : 2010/11/18

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.