org.zkoss.zul
Class Script

java.lang.Object
  extended by org.zkoss.zk.ui.AbstractComponent
      extended by org.zkoss.zul.Script
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.sys.ComponentCtrl

public class Script
extends org.zkoss.zk.ui.AbstractComponent

A component to represent script codes running at the client. It is the same as HTML SCRIPT tag.

Note: it is the scripting codes running at the client, not at the server. Don't confuse it with the zscript element.

To avoid typo, this compnent requires you to specify the type (setType(java.lang.String)) -- which is, if JavaScript, "text/javascript".

Author:
tomyeh
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
 
Constructor Summary
Script()
           
 
Method Summary
 java.lang.String getCharset()
          Returns the character enconding of the source.
 java.lang.String getSrc()
          Returns the URI of the source that contains the script codes.
 java.lang.String getType()
          Returns the type of this client script.
 boolean insertBefore(org.zkoss.zk.ui.Component child, org.zkoss.zk.ui.Component insertBefore)
          Only Label children are allowed.
 boolean isDefer()
          Returns whether to defer the execution of the script codes.
 void redraw(java.io.Writer out)
           
 void setCharset(java.lang.String charset)
          Sets the character encoding of the source.
 void setDefer(boolean defer)
          Sets whether to defer the execution of the script codes.
 void setSrc(java.lang.String src)
          Sets the URI of the source that contains the script codes.
 void setType(java.lang.String type)
          Sets the type of this client script.
 
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addEventHandler, addEventListener, addSharedAnnotationMap, addSharedEventHandlerMap, appendChild, applyProperties, clone, containsVariable, detach, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttributes, getAttributes, getChildren, getDefinition, getDesktop, getEventHandler, getExtraCtrl, getFellow, getFellowIfAny, getId, getListenerIterator, getMold, getMoldURI, getNamespace, getPage, getParent, getPropagatee, getRoot, getSpaceOwner, getUuid, getVariable, invalidate, isChildable, isListenerAvailable, isVisible, newExtraCtrl, onChildAdded, onChildRemoved, onDrawNewChild, onWrongValue, removeAttribute, removeAttribute, removeChild, removeEventListener, response, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setComponentDefinition, setId, setMold, setPage, setParent, setVariable, setVisible, smartUpdate, smartUpdate, smartUpdate, toString, unsetVariable
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Script

public Script()
Method Detail

getType

public java.lang.String getType()
Returns the type of this client script.

Default: null. However, it is invalid. In other words, you must specify a correct type. For JavaScript, it is "text/javascript".


setType

public void setType(java.lang.String type)
Sets the type of this client script. For JavaScript, it is text/javascript

Note: this property is NOT optional. You must specify one.


getCharset

public java.lang.String getCharset()
Returns the character enconding of the source. It is used with getSrc().

Default: null.


setCharset

public void setCharset(java.lang.String charset)
Sets the character encoding of the source. It is used with setSrc(java.lang.String).


getSrc

public java.lang.String getSrc()
Returns the URI of the source that contains the script codes.

Default: null.


setSrc

public void setSrc(java.lang.String src)
Sets the URI of the source that contains the script codes.

You either add the script codes directly with the Label children, or set the URI to load the script codes with setSrc(java.lang.String). But, not both.

Parameters:
src - the URI of the source that contains the script codes

isDefer

public boolean isDefer()
Returns whether to defer the execution of the script codes.

Default: false.


setDefer

public void setDefer(boolean defer)
Sets whether to defer the execution of the script codes.


insertBefore

public boolean insertBefore(org.zkoss.zk.ui.Component child,
                            org.zkoss.zk.ui.Component insertBefore)
Only Label children are allowed.

Specified by:
insertBefore in interface org.zkoss.zk.ui.Component
Overrides:
insertBefore in class org.zkoss.zk.ui.AbstractComponent

redraw

public void redraw(java.io.Writer out)
            throws java.io.IOException
Specified by:
redraw in interface org.zkoss.zk.ui.Component
Overrides:
redraw in class org.zkoss.zk.ui.AbstractComponent
Throws:
java.io.IOException


Copyright © 2005-2007 Potix Corporation. All Rights Reserved.