org.zkoss.zul
Class Bandbox

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
                      extended by org.zkoss.zul.Bandbox
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.sys.ComponentCtrl, Constrainted

public class Bandbox
extends Textbox

A band box. A bank box consists of an input box (Textbox and a popup window Bandpopup. It is similar to Combobox except the popup window could have any kind of children. For example, you could place a textbox in the popup to let user search particular items.

Default HtmlBasedComponent.getSclass(): bandbox.

Events: onOpen
Developers can listen to the onOpen event and initializes it when OpenEvent.isOpen() is true, and/or clean up if false.

Note: to have better performance, onOpen is sent only if a non-deferrable event listener is registered (see Deferrable).

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
Bandbox()
           
Bandbox(java.lang.String value)
           
 
Method Summary
 java.lang.Object clone()
           
 void closeDropdown()
          Closes the popup (getDropdown()).
 Bandpopup getDropdown()
          Returns the dropdown window belonging to this band box.
 java.lang.String getImage()
          Returns the image URI that is displayed as the button to open Bandpopup.
 java.lang.String getInnerAttrs()
          Generates the Client-Side-Action attributes to the interior tag.
 java.lang.String getOuterAttrs()
           
protected  int getRealStyleFlags()
          Returns RS_NO_WIDTH|RS_NO_HEIGHT.
 boolean insertBefore(org.zkoss.zk.ui.Component newChild, org.zkoss.zk.ui.Component refChild)
           
 boolean isAutodrop()
          Returns whether to automatically drop the list if users is changing this text box.
 boolean isButtonVisible()
          Returns whether the button (on the right of the textbox) is visible.
 boolean isChildable()
          Childable.
 void onChildRemoved(org.zkoss.zk.ui.Component child)
           
 void setAutodrop(boolean autodrop)
          Sets whether to automatically drop the list if users is changing this text box.
 void setButtonVisible(boolean visible)
          Sets whether the button (on the right of the textbox) is visible.
 void setImage(java.lang.String img)
          Sets the image URI that is displayed as the button to open Bandpopup.
 void setMultiline(boolean multiline)
          Sets whether it is multiline.
 void setRows(int rows)
          Sets the rows.
 
Methods inherited from class org.zkoss.zul.Textbox
coerceFromString, coerceToString, getRows, getType, getValue, isMultiline, setType, setValue
 
Methods inherited from class org.zkoss.zul.impl.InputElement
checkUserError, clearErrorMessage, getAreaText, getCols, getConstraint, getErrorMessage, getMaxlength, getName, getRawText, getRawValue, getTabindex, getTargetValue, getText, isAsapRequired, 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, 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, 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, isListenerAvailable, isVisible, onChildAdded, 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

Bandbox

public Bandbox()

Bandbox

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

getDropdown

public Bandpopup getDropdown()
Returns the dropdown window belonging to this band box.


closeDropdown

public void closeDropdown()
Closes the popup (getDropdown()).


isAutodrop

public boolean isAutodrop()
Returns whether to automatically drop the list if users is changing this text box.

Default: false.


setAutodrop

public void setAutodrop(boolean autodrop)
Sets whether to automatically drop the list if users is changing this text box.


isButtonVisible

public boolean isButtonVisible()
Returns whether the button (on the right of the textbox) is visible.

Default: true.


setButtonVisible

public void setButtonVisible(boolean visible)
Sets whether the button (on the right of the textbox) is visible.


getImage

public java.lang.String getImage()
Returns the image URI that is displayed as the button to open Bandpopup.

Default: "~./zul/img/bandbtn.gif".


setImage

public void setImage(java.lang.String img)
Sets the image URI that is displayed as the button to open Bandpopup.

Parameters:
img - the image URI. If null or empty, it is reset to the default value: "~./zul/img/bandbtn.gif".

setMultiline

public void setMultiline(boolean multiline)
Description copied from class: Textbox
Sets whether it is multiline.

Overrides:
setMultiline in class Textbox

setRows

public void setRows(int rows)
Description copied from class: Textbox
Sets the rows.

Overrides:
setRows in class Textbox

getOuterAttrs

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

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 Textbox

getRealStyleFlags

protected int getRealStyleFlags()
Returns RS_NO_WIDTH|RS_NO_HEIGHT.

Overrides:
getRealStyleFlags in class org.zkoss.zk.ui.HtmlBasedComponent

insertBefore

public boolean insertBefore(org.zkoss.zk.ui.Component newChild,
                            org.zkoss.zk.ui.Component refChild)
Specified by:
insertBefore in interface org.zkoss.zk.ui.Component
Overrides:
insertBefore in class org.zkoss.zk.ui.AbstractComponent

isChildable

public boolean isChildable()
Childable.

Specified by:
isChildable in interface org.zkoss.zk.ui.Component
Overrides:
isChildable in class InputElement

onChildRemoved

public void onChildRemoved(org.zkoss.zk.ui.Component child)
Specified by:
onChildRemoved in interface org.zkoss.zk.ui.Component
Overrides:
onChildRemoved in class org.zkoss.zk.ui.AbstractComponent

clone

public java.lang.Object clone()
Specified by:
clone in interface org.zkoss.zk.ui.Component
Overrides:
clone in class org.zkoss.zk.ui.AbstractComponent


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