org.zkoss.zul
Class Textbox

java.lang.Object
  extended by org.zkoss.zk.ui.AbstractComponent
      extended by org.zkoss.zk.ui.HtmlBasedComponent
          extended by org.zkoss.zul.impl.XulElement
              extended by org.zkoss.zul.impl.InputElement
                  extended by org.zkoss.zul.Textbox
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.sys.ComponentCtrl, Constrainted
Direct Known Subclasses:
Bandbox, Combobox

public class Textbox
extends InputElement

A textbox.

See Specification.

Author:
tomyeh
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.zkoss.zul.impl.InputElement
InputElement.ExtraCtrl
 
Field Summary
 
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
RS_NO_DISPLAY, RS_NO_HEIGHT, RS_NO_WIDTH
 
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
Textbox()
           
Textbox(java.lang.String value)
           
 
Method Summary
protected  java.lang.Object coerceFromString(java.lang.String value)
          Coerces the value passed to setValue(java.lang.String).
protected  java.lang.String coerceToString(java.lang.Object value)
          Coerces the value passed to setValue(java.lang.String).
 java.lang.String getInnerAttrs()
          Generates the Client-Side-Action attributes to the interior tag.
 java.lang.String getOuterAttrs()
           
 int getRows()
          Returns the rows.
 java.lang.String getType()
          Returns the type.
 java.lang.String getValue()
          Returns the value.
 boolean isMultiline()
          Returns whether it is multiline.
 void setMultiline(boolean multiline)
          Sets whether it is multiline.
 void setRows(int rows)
          Sets the rows.
 void setType(java.lang.String type)
          Sets the type.
 void setValue(java.lang.String value)
          Sets the value.
 
Methods inherited from class org.zkoss.zul.impl.InputElement
checkUserError, clearErrorMessage, getAreaText, getCols, getConstraint, getErrorMessage, getMaxlength, getName, getRawText, getRawValue, getTabindex, getTargetValue, getText, isAsapRequired, isChildable, isDisabled, isReadonly, isValid, newExtraCtrl, onWrongValue, select, setCols, setConstraint, setConstraint, setDisabled, setMaxlength, setName, setRawValue, setReadonly, setSelectedText, setSelectionRange, setTabindex, setText, showCustomError, validate
 
Methods inherited from class org.zkoss.zul.impl.XulElement
getAction, getAllOnClickAttrs, getContext, getPopup, getTooltip, setAction, setContext, setPopup, setTooltip
 
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addEventListener, appendAsapAttr, focus, getDraggable, getDroppable, getHeight, getLeft, getRealStyle, getRealStyleFlags, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZIndex, removeEventListener, setClass, setDraggable, setDroppable, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZIndex
 
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addEventHandler, 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, insertBefore, invalidate, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onDrawNewChild, redraw, removeAttribute, removeAttribute, removeChild, 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

Textbox

public Textbox()

Textbox

public Textbox(java.lang.String value)
        throws org.zkoss.zk.ui.WrongValueException
Throws:
org.zkoss.zk.ui.WrongValueException
Method Detail

getValue

public java.lang.String getValue()
                          throws org.zkoss.zk.ui.WrongValueException
Returns the value. The same as InputElement.getText().

Default: "".

Throws:
org.zkoss.zk.ui.WrongValueException - if user entered a wrong value

setValue

public void setValue(java.lang.String value)
              throws org.zkoss.zk.ui.WrongValueException
Sets the value.

Parameters:
value - the value; If null, it is considered as empty.
Throws:
org.zkoss.zk.ui.WrongValueException - if value is wrong

coerceFromString

protected java.lang.Object coerceFromString(java.lang.String value)
                                     throws org.zkoss.zk.ui.WrongValueException
Coerces the value passed to setValue(java.lang.String).

Default: convert null to an empty string.

Specified by:
coerceFromString in class InputElement
Throws:
org.zkoss.zk.ui.WrongValueException

coerceToString

protected java.lang.String coerceToString(java.lang.Object value)
Coerces the value passed to setValue(java.lang.String).

Default: convert null to an empty string.

Specified by:
coerceToString in class InputElement

getType

public java.lang.String getType()
Returns the type.

Default: text.

Overrides:
getType in class InputElement

setType

public void setType(java.lang.String type)
             throws org.zkoss.zk.ui.WrongValueException
Sets the type.

Parameters:
type - the type. Acceptable values are "text" and "password". Unlike XUL, "timed" is redudant because it is enabled as long as onChanging is added.
Throws:
org.zkoss.zk.ui.WrongValueException

getRows

public int getRows()
Returns the rows.

Default: 1.


setRows

public void setRows(int rows)
             throws org.zkoss.zk.ui.WrongValueException
Sets the rows.

Throws:
org.zkoss.zk.ui.WrongValueException

isMultiline

public boolean isMultiline()
Returns whether it is multiline.

Default: false.

Overrides:
isMultiline in class InputElement

setMultiline

public void setMultiline(boolean multiline)
Sets whether it is multiline.


getInnerAttrs

public java.lang.String getInnerAttrs()
Description copied from class: XulElement
Generates the Client-Side-Action attributes to the interior tag. Reason: onfocus is the main use.

Overrides:
getInnerAttrs in class InputElement

getOuterAttrs

public java.lang.String getOuterAttrs()
Overrides:
getOuterAttrs in class InputElement


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