|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zul.impl.InputElement
org.zkoss.zul.Textbox
org.zkoss.zul.Bandbox
public class Bandbox
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 getZclass(): z-bandbox.(since 3.5.0)
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).
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.zkoss.zul.impl.InputElement |
|---|
InputElement.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, RS_NO_DISPLAY, RS_NO_HEIGHT, RS_NO_WIDTH |
| Fields inherited from class org.zkoss.zk.ui.AbstractComponent |
|---|
_visible |
| 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 | |
|---|---|
void |
beforeChildAdded(Component newChild,
Component refChild)
Default: does nothing. |
java.lang.Object |
clone()
Clones the component. |
void |
close()
Closes the child if it was dropped down. |
void |
closeDropdown()
Deprecated. As of release 3.6.1, use close() instead. |
Bandpopup |
getDropdown()
Returns the dropdown window belonging to this band box. |
Bandpopup |
getDropdownApi()
Returns the dropdown window belonging to this band box. |
java.lang.String |
getImage()
Deprecated. As of release 3.5.0 |
java.lang.String |
getInnerAttrs()
Generates the Client-Side-Action attributes to the interior tag. |
java.lang.String |
getOuterAttrs()
Returns the exterior attributes for generating the enclosing HTML tag; never return null. |
protected int |
getRealStyleFlags()
Returns RS_NO_WIDTH|RS_NO_HEIGHT. |
java.lang.String |
getZclass()
Returns the ZK Cascading Style class(es) for this component. |
boolean |
insertBefore(Component newChild,
Component refChild)
Inserts a child before the reference child. |
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(Component child)
Default: does nothing. |
void |
open()
Drops down the 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)
Deprecated. As of release 3.5.0 |
void |
setMultiline(boolean multiline)
Bandbox can't be enabled the multiline functionality. |
void |
setOpen(boolean open)
Drops down or closes the child. |
void |
setRows(int rows)
Bandbox can't be enabled the rows functionality. |
| Methods inherited from class org.zkoss.zul.Textbox |
|---|
coerceFromString, coerceToString, getRows, getType, getValue, isMultiline, isTabbable, setTabbable, setType, setValue |
| Methods inherited from class org.zkoss.zul.impl.InputElement |
|---|
checkUserError, clearErrorMessage, clearErrorMessage, getAreaText, getCols, getConstraint, getErrorMessage, getMaxlength, getName, getRawText, getRawValue, getTabindex, getTargetValue, getText, isDisabled, isReadonly, isValid, newExtraCtrl, onWrongValue, select, setCols, setConstraint, setConstraint, setDisabled, setMaxlength, setName, setRawValue, setReadonly, setSelectedText, setSelectionRange, setTabindex, setText, setValueDirectly, shallServerFormat, showCustomError, validate |
| Methods inherited from class org.zkoss.zul.impl.XulElement |
|---|
getAction, getActionAttrs, getAllOnClickAttrs, getContext, getCtrlKeys, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip |
| Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
focus, getAllOnClickAttrs, getDraggable, getDroppable, getHeight, getLeft, getMoldSclass, getRealSclass, getRealStyle, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZindex, getZIndex, redraw, setClass, setDraggable, setDroppable, setFocus, setHeight, setLeft, setMoldSclass, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.zkoss.zul.api.Textbox |
|---|
getRows, getValue, setType, setValue |
| Methods inherited from interface org.zkoss.zul.impl.api.InputElement |
|---|
clearErrorMessage, clearErrorMessage, getAreaText, getCols, getErrorMessage, getMaxlength, getName, getRawText, getRawValue, getTabindex, getText, getType, isDisabled, isMultiline, isReadonly, isValid, select, setCols, setConstraint, setDisabled, setMaxlength, setName, setRawValue, setReadonly, setSelectedText, setSelectionRange, setTabindex, setText |
| Methods inherited from interface org.zkoss.zul.impl.api.XulElement |
|---|
getAction, getContext, getCtrlKeys, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip |
| Methods inherited from interface org.zkoss.zk.ui.api.HtmlBasedComponent |
|---|
focus, getHeight, getLeft, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZindex, getZIndex, setDraggable, setDroppable, setFocus, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex |
| Methods inherited from interface org.zkoss.zul.ext.Constrainted |
|---|
getConstraint, setConstraint |
| Constructor Detail |
|---|
public Bandbox()
public Bandbox(java.lang.String value)
throws WrongValueException
WrongValueException| Method Detail |
|---|
public Bandpopup getDropdown()
public Bandpopup getDropdownApi()
getDropdownApi in interface Bandboxpublic void closeDropdown()
close() instead.
BandboxBandbox.getDropdownApi()).
closeDropdown in interface Bandboxpublic boolean isAutodrop()
Default: false.
public void setAutodrop(boolean autodrop)
setAutodrop in interface Bandboxpublic boolean isButtonVisible()
Default: true.
isButtonVisible in interface Bandboxpublic void setButtonVisible(boolean visible)
setButtonVisible in interface Bandboxpublic java.lang.String getImage()
Bandpopup.
Default: null. (since 3.5.0)
public void setImage(java.lang.String img)
Bandpopup.
img - the image URI.public void setOpen(boolean open)
setOpen in interface Bandboxopen(),
close()public void open()
open in interface Bandboxpublic void close()
close in interface Bandboxpublic void setMultiline(boolean multiline)
setMultiline in interface TextboxsetMultiline in class Textboxpublic void setRows(int rows)
setRows in interface TextboxsetRows in class Textboxpublic java.lang.String getZclass()
HtmlBasedComponentDefault: null (the default value depends on element).
HtmlBasedComponent.setZclass(java.lang.String)) will completely replace the default style
of a component. In other words, the default style of a component
is associated with the default value of HtmlBasedComponent.getZclass().
Once it is changed, the default style won't be applied at all.
If you want to perform small adjustments, use HtmlBasedComponent.setSclass(java.lang.String)
instead.
getZclass in interface HtmlBasedComponentgetZclass in class TextboxHtmlBasedComponent.getSclass(),
HtmlBasedComponent.getRealSclass()public java.lang.String getOuterAttrs()
HtmlBasedComponentUsed only by component developers.
Default: Generates the tooltip text, style, sclass, draggable
and droppable attribute if necessary.
In other words, the corresponding attribute is generated if
HtmlBasedComponent.getTooltiptext(), HtmlBasedComponent.getRealStyle(),
HtmlBasedComponent.getSclass(), HtmlBasedComponent.getDraggable(), HtmlBasedComponent.getDroppable()
are defined.
You have to call both HtmlBasedComponent.getOuterAttrs() and
HtmlBasedComponent.getInnerAttrs() to generate complete attributes.
For simple components that all attributes are put on the outest HTML element, all you need is as follows.
<xx id="${self.uuid}"${self.outerAttrs}${self.innerAttrs}>
If you want to put attributes in a nested HTML element, you
shall use the following pattern. Notice: if HtmlBasedComponent.getInnerAttrs()
in a different tag, the tag must be named with "${self.uuid}!real".
<xx id="${self.uuid}"${self.outerAttrs}>
<yy id="${self.uuid}!real"${self.innerAttrs}>...
Note: This class handles non-deferrable event listeners automatically.
However, you have to invoke AbstractComponent.appendAsapAttr(java.lang.StringBuffer, java.lang.String) for each event
the component handles in HtmlBasedComponent.getOuterAttrs() as follows.
appendAsapAttr(sb, Events.ON_OPEN);
appendAsapAttr(sb, Events.ON_CHANGE);
Theorectically, you could put any attributes in either
HtmlBasedComponent.getInnerAttrs() or HtmlBasedComponent.getOuterAttrs().
However, zkau.js assumes all attributes are put at the outer one.
If you want something different, you have to provide your own
setAttr (refer to how checkbox is implemented).
getOuterAttrs in class Textboxpublic java.lang.String getInnerAttrs()
XulElement
getInnerAttrs in class Textboxprotected int getRealStyleFlags()
getRealStyleFlags in class HtmlBasedComponent
public void beforeChildAdded(Component newChild,
Component refChild)
AbstractComponent
beforeChildAdded in interface ComponentCtrlbeforeChildAdded in class AbstractComponentnewChild - the child to be added (never null).refChild - another child component that the new child
will be inserted before it. If null, the new child will be the
last child.ComponentCtrl.beforeChildAdded(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)
public boolean insertBefore(Component newChild,
Component refChild)
ComponentYou could use Component.setParent(org.zkoss.zk.ui.Component) or Component.appendChild(org.zkoss.zk.ui.Component)
instead of this method, unless
you want to control where to put the child.
Note: Component.setParent(org.zkoss.zk.ui.Component) always calls back Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)
and/or Component.removeChild(org.zkoss.zk.ui.Component),
while Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component) and Component.removeChild(org.zkoss.zk.ui.Component)
always calls back Component.setParent(org.zkoss.zk.ui.Component),
if the parent is changed. Thus, you don't need to override
both Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component) and Component.setParent(org.zkoss.zk.ui.Component), if you want
to customize the behavior.
insertBefore in interface ComponentinsertBefore in class AbstractComponentnewChild - the new child to be inserted.refChild - the child before which you want the new child
being inserted. If null, the new child is append to the end.
public boolean isChildable()
isChildable in interface ComponentisChildable in class InputElementpublic void onChildRemoved(Component child)
AbstractComponent
onChildRemoved in interface ComponentCtrlonChildRemoved in class AbstractComponentComponentCtrl.onChildRemoved(org.zkoss.zk.ui.Component)public java.lang.Object clone()
Component
clone in interface Componentclone in class AbstractComponent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||