Interface IBandbox
- All Superinterfaces:
IAnyGroup<IBandbox>,IChildrenOfInputgroup<IBandbox>,IComponent<IBandbox>,IHtmlBasedComponent<IBandbox>,IInputElement<IBandbox,,String> IReadonly<IBandbox>,ISingleChildable<IBandbox,,IBandpopup> ITextboxBase<IBandbox>,IXulElement<IBandbox>
Bandbox component.
A bandbox is a special text box that embeds a customizable popup window
(aka., a dropdown window). Like comboboxes, a bandbox consists of an input box
and a popup window. The popup window is opened automatically, when a user presses
Alt+DOWN or clicks the magnifier button.
Unlike comboboxes, the popup window of a bandbox could be anything. It is designed to give developers the maximal flexibility. A typical use is to represent the popup window as a search dialog.
Support @Action
| Name | Action Type |
|---|---|
| onOpen | ActionData: OpenData
Denotes user has opened or closed a component. Note: unlike onClose, this action is only a notification.
The client sends this action after opening or closing the component. |
Mouseless Entry
Alt+DOWNto pop up the list.Alt+UPorESCto close the list.
Constraint
You could specify what value to accept for input controls by use of the
constraint attribute. It could be no empty,
and/or a regular expression.
To specify two or more constraints, use comma to separate them as follows.
IBandbox.ofConstraint("no empty,/^A/");
To specify a regular expression, you may have to use the character /
to enclose the regular expression as follows.
IBandbox.ofConstraint("/^A/");
If you prefer to display different message to the default one, you can append the error message to the constraint with a colon.
IBandbox.ofConstraint("/^A/: only allowed the item start with A");- Author:
- katherine
- See Also:
-
Bandbox
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classBuilds instances of typeIBandbox.static classBuilds an updater of typeIBandboxforUiAgent.smartUpdate(Locator, SmartUpdater).Nested classes/interfaces inherited from interface org.zkoss.stateless.sul.ITextboxBase
ITextboxBase.Type -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault StringReturns the iconSclass name of this Bandbox.Returns the width of the popup of this componentdefault StringReturns the client widget class.default booleanReturns whether to automatically drop the list if users is changing this text box.default booleanReturns whether the button (on the right of the timebox) is visible.default booleanisOpen()Returns whether this bandbox is open.static IBandboxReturn the instance of the given value.static IBandboxof(String value, IBandpopup bandpopup) Return the instance of the given value and bandpopup child.static IBandboxof(IBandpopup bandpopup) Return the instance of the given bandpopup child.static IBandboxofCols(int cols) Returns the instance with the given cols.static IBandboxofConstraint(String constraint) Returns the instance with the given constraint.static IBandboxReturns the instance with the given id.withAutodrop(boolean autodrop) Returns a copy ofthisimmutable component with the specifiedautodrop.withButtonVisible(boolean buttonVisible) Returns a copy ofthisimmutable component with the specifiedbuttonVisible.withIconSclass(String iconSclass) Returns a copy ofthisimmutable component with the specifiediconSclass.withOpen(boolean open) Returns a copy ofthisimmutable component with the specifiedsclass.withPopupWidth(String popupWidth) Returns a copy ofthisimmutable component with the specifiedpopupWidth.Methods inherited from interface org.zkoss.stateless.sul.IComponent
getAction, getActions, getClientAttributes, getId, getMold, getWidgetListeners, getWidgetOverrides, isVisible, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withActions, withActions, withClientAttribute, withClientAttributes, withId, withMold, withVisible, withWidgetClass, withWidgetListener, withWidgetListeners, withWidgetOverride, withWidgetOverridesMethods inherited from interface org.zkoss.stateless.sul.IHtmlBasedComponent
getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getSkeleton, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, withSkeleton, withStyle, withTabindex, withTabindex, withTooltiptext, withTop, withVflex, withWidth, withZclass, withZIndexMethods inherited from interface org.zkoss.stateless.sul.IInputElement
getCols, getConstraint, getErrorboxIconSclass, getErrorboxSclass, getErrorMessage, getInputAttributes, getInstant, getMaxlength, getName, getPlaceholder, getValue, isDisabled, isInplace, withCols, withConstraint, withDisabled, withErrorboxIconSclass, withErrorboxSclass, withErrorMessage, withInplace, withInputAttributes, withInstant, withMaxlength, withName, withPlaceholderMethods inherited from interface org.zkoss.stateless.sul.IReadonly
isReadonly, withReadonlyMethods inherited from interface org.zkoss.stateless.sul.ISingleChildable
getChild, withChildMethods inherited from interface org.zkoss.stateless.sul.ITextboxBase
getRows, getType, isMultiline, isSubmitByEnter, isTabbable, withMultiline, withRows, withSubmitByEnter, withTabbable, withType, withType, withValueMethods inherited from interface org.zkoss.stateless.sul.IXulElement
getContext, getCtrlKeys, getPopup, getTooltip, withContext, withCtrlKeys, withPopup, withTooltip
-
Field Details
-
DEFAULT
Constant for default attributes of this immutable component.
-
-
Method Details
-
getWidgetClass
Returns the client widget class.Default:
"zul.inp.Bandbox"- Specified by:
getWidgetClassin interfaceIComponent<IBandbox>
-
getPopupWidth
Returns the width of the popup of this componentDefault:
null -
withPopupWidth
Returns a copy ofthisimmutable component with the specifiedpopupWidth.Sets the width of the popup of this component. If the input is a percentage, the popup width will be calculated by multiplying the width of this component with the percentage. (e.g. if the input string is
130%, and the width of this component is300px, the popup width will be390px = 300px * 130%) Others will be set directly.- Parameters:
popupWidth- The width of the popup of this component.Default:
null.- Returns:
- A modified copy of the
thisobject
-
isAutodrop
default boolean isAutodrop()Returns whether to automatically drop the list if users is changing this text box.Default:
false. -
withAutodrop
Returns a copy ofthisimmutable component with the specifiedautodrop.Sets whether to automatically drop the list if users is changing this text box.
- Parameters:
autodrop-trueto enable the auto-drop facility.Default:
false.- Returns:
- A modified copy of the
thisobject
-
isButtonVisible
default boolean isButtonVisible()Returns whether the button (on the right of the timebox) is visible.Default:
true. -
withButtonVisible
Returns a copy ofthisimmutable component with the specifiedbuttonVisible.Sets whether the button (on the right of the bandbox) is visible.
- Parameters:
buttonVisible-falseto disable the button visibility.Default:
true.- Returns:
- A modified copy of the
thisobject
-
getIconSclass
Returns the iconSclass name of this Bandbox.Default:
Bandbox.ICON_SCLASS -
withIconSclass
Returns a copy ofthisimmutable component with the specifiediconSclass.Sets the iconSclass name of this Bandbox.
- Parameters:
iconSclass- The iconSclass name of this Bandbox.Default:
Bandbox.ICON_SCLASS- Returns:
- A modified copy of the
thisobject
-
isOpen
default boolean isOpen()Returns whether this bandbox is open.Default:
false. -
withOpen
Returns a copy ofthisimmutable component with the specifiedsclass.Sets whether this bandbox is open or not.
- Parameters:
open-trueto open the dropdown.Default:
false- Returns:
- A modified copy of the
thisobject
-
of
Return the instance of the given value.- Parameters:
value- The value of the text box.
-
of
Return the instance of the given value and bandpopup child.- Parameters:
value- The value of the text box.bandpopup- The popup child of the bandbox
-
of
Return the instance of the given bandpopup child.- Parameters:
bandpopup- The popup child of the bandbox
-
ofCols
Returns the instance with the given cols.- Parameters:
cols- The cols which determines the visible width
-
ofConstraint
Returns the instance with the given constraint.- Parameters:
constraint- The bandbox constraint
-
ofId
Returns the instance with the given id.- Parameters:
id- The id to identify this component
-