|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.zkoss.zk.ui.AbstractComponent org.zkoss.zk.ui.HtmlBasedComponent org.zkoss.zul.impl.XulElement org.zkoss.zul.Html
public class Html
A comonent used to embed the browser native content (i.e., HTML tags)
into the output sent to the browser.
The browser native content is specified by setContent(java.lang.String)
.
Notice that Html
generates HTML SPAN to enclose
the embedded HTML tags. Thus, you can specify the style
(HtmlBasedComponent.getStyle()
), tooltip XulElement.getTooltip()
and so on.
<html style="border: 1px solid blue"><![CDATA[
<ul>
<li>It is in a SPAN tag.</li>
</ul>
]]></html>
The generated HTML tags will look like:
<SPAN id="xxx" style="border: 1px solid blue">
<ul>
<li>It is in a SPAN tag.</li>
</ul>
</SPAN>
Since SPAN is used to enclosed the embedded HTML tags, so the following is incorrect.
<html><![CDATA[
<table>
<tr>
<td> <-- Incomplete since it is inside SPAN -->
]]></html>
<textbox/>
<html><![CDATA[
</td>
</tr>
</table>
]]></html>
If you need to generate the HTML tags directly without enclosing with SPAN, you can use the Native namespace, http://www.zkoss.org/2005/zk/native. Refer to ZK Developer's Reference for more information.
A non-XUL extension.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
---|
HtmlBasedComponent.ExtraCtrl |
Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent |
---|
AbstractComponent.Children |
Field Summary |
---|
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
---|
_zclass |
Fields inherited from interface org.zkoss.zk.ui.Component |
---|
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE |
Fields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl |
---|
CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE |
Constructor Summary | |
---|---|
Html()
Contructs a Html component to embed HTML tags. |
|
Html(java.lang.String content)
Contructs a Html component to embed HTML tags
with the specified content. |
Method Summary | |
---|---|
java.lang.String |
getContent()
Returns the embedded content (i.e., HTML tags). |
protected boolean |
isChildable()
Default: not childable. |
protected void |
renderProperties(ContentRenderer renderer)
Renders the content of this component, excluding the enclosing tags and children. |
void |
setContent(java.lang.String content)
Sets the embedded content (i.e., HTML tags). |
Methods inherited from class org.zkoss.zul.impl.XulElement |
---|
clone, getContext, getCtrlKeys, getPopup, getTooltip, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip |
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
---|
focus, getAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZindex, getZIndex, service, setAction, setClass, setDraggable, setDroppable, setFocus, setHeight, setHeightDirectly, setHflex, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTooltiptext, setTop, setTopDirectly, setVflex, setWidth, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Html()
Html
component to embed HTML tags.
public Html(java.lang.String content)
Html
component to embed HTML tags
with the specified content.
Method Detail |
---|
public java.lang.String getContent()
public void setContent(java.lang.String content)
Default: empty ("").
Deriving class can override it to return whatever it wants other than null.
Unlike other methods, the content assigned to this method is generated directly to the browser without escaping. Thus, it is better not to have something input by the user to avoid any XSS attach.
protected void renderProperties(ContentRenderer renderer) throws java.io.IOException
HtmlBasedComponent
See also ZK Client-side Reference: Property Rendering
renderProperties
in class XulElement
java.io.IOException
protected boolean isChildable()
isChildable
in class AbstractComponent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |