Interface IChosenbox
- All Superinterfaces:
IAnyGroup<IChosenbox>,IComponent<IChosenbox>,IHtmlBasedComponent<IChosenbox>
Chosenbox component
A component that similar to ICombobox but handle the multi-selection
and the select order.
It does not create child widgets for each data, so the memory usage is much lower at the server.
Support @Action
| Name | Action Type |
|---|---|
| onSelect | ActionData: SelectData
Represents an action caused by user's the selection changed at the client. |
| onOpen | ActionData: OpenData
Represents an action that indicates an open state that is changed at the client. |
| onSearch | ActionData: InputData
Represents an action that indicates users inputting an non-existing value by clicking ENTER or separator. |
| onSearching | ActionData: InputData
Represents an action sent back to the server caused by user's input text. |
| onItemClick | Represents an action sent back to the server caused by clicking a selected tag. |
Mouseless Entry
- Press
UPandDOWNto move the focus up and down by one option - Press
LEFTandRIGHTto move focus between selected item(s) and the input field. - Press
ESCto clear input and close drop-down list. - Press
DELETEto delete the focused item and move focus to next item if any or input field. - Press
BACKSPACEto delete the focused item and move focus to previous item if any or input field. - Press
ENTERor specified separator to select the focused option.
- Author:
- katherine
- See Also:
-
Chosenbox
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classBuilds instances of typeIChosenbox.static classBuilds an updater of typeIChosenboxforUiAgent.smartUpdate(Locator, SmartUpdater). -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IChosenboxConstant for default attributes of this immutable component. -
Method Summary
Modifier and TypeMethodDescriptionReturns the creating message of this component.Returns the emptyMessage of the input of this component.Returns the additional attributes which is set bywithInputAttributes(Map)getName()Returns the name of this component.Returns the no-result text of this component.Returns the separate chars of this component.default StringReturns the client widget class.default booleanReturns whether creates new item by default.default booleanReturns whether it is disabled.default booleanReturn whether to display Chosenbox's selection as a comma separate label, underwithIinplace(true), when user clicks the label, it turns into a chosenbox.default booleanisOpen()Returns whether to open or not.static IChosenboxReturns the instance with the given id.withCreatable(boolean creatable) Returns a copy ofthisimmutable component with the specifiedcreatable.withCreateMessage(String createMessage) Returns a copy ofthisimmutable component with the specifiedcreateMessage.withDisabled(boolean disabled) Returns a copy ofthisimmutable component with the specifieddisabled.withEmptyMessage(String emptyMessage) Returns a copy ofthisimmutable component with the specifiedemptyMessage.withInplace(boolean inplace) Returns a copy ofthisimmutable component with the specifiedinplace.withInputAttributes(Map<String, ? extends String> inputAttributes) Returns a copy ofthisimmutable component with the specifiedinputAttributes.Returns a copy ofthisimmutable component with the specifiedname.withNoResultsText(String noResultsText) Returns a copy ofthisimmutable component with the specifiednoResultsText.withOpen(boolean open) Returns a copy ofthisimmutable component with the specifiedopen.withSeparator(String separator) Returns a copy ofthisimmutable component with the specifiedseparator.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, withZIndex
-
Field Details
-
DEFAULT
Constant for default attributes of this immutable component.
-
-
Method Details
-
getWidgetClass
Returns the client widget class.Default:
"zkmax.inp.Chosenbox"- Specified by:
getWidgetClassin interfaceIComponent<IChosenbox>
-
getName
Returns the name of this component.Default:
null.Don't use this method if your application is purely based on ZK's event-driven model.
The name is used only to work with "legacy" Web application that handles user's request by servlets. It works only with HTTP/HTML-based browsers. It doesn't work with other kind of clients.
-
withName
Returns a copy ofthisimmutable component with the specifiedname.Sets the name of this component.
Don't use this method if your application is purely based on ZK's event-driven model.
The name is used only to work with "legacy" Web application that handles user's request by servlets. It works only with HTTP/HTML-based browsers. It doesn't work with other kind of clients.
- Parameters:
name- The value of the component.Default:
null.- Returns:
- A modified copy of the
thisobject
-
getEmptyMessage
Returns the emptyMessage of the input of this component.Default:
null.The emptyMessage will be displayed in input if nothing selected and not focused.
-
withEmptyMessage
Returns a copy ofthisimmutable component with the specifiedemptyMessage.Sets the emptyMessage of the input of this component.
The emptyMessage will be displayed in input if nothing selected and not focused.
- Parameters:
emptyMessage- The empty message of the input of this component.Default:
null.- Returns:
- A modified copy of the
thisobject
-
getInputAttributes
Returns the additional attributes which is set bywithInputAttributes(Map)Default:
null.- Since:
- 11.0.0
-
withInputAttributes
Returns a copy ofthisimmutable component with the specifiedinputAttributes.Sets some additional attributes to the filter input HTML tag of the component at client, for example
autocomplete=country-name.- Parameters:
inputAttributes- A Map with attribute names as the keys.Default:
null.- Returns:
- A modified copy of the
thisobject - Since:
- 11.0.0
-
getNoResultsText
Returns the no-result text of this component.Default:
null.The no-result text will be displayed in popup if nothing match to the input value and can not create either, the syntax
"{0}"will be replaced with the input value at client side. -
withNoResultsText
Returns a copy ofthisimmutable component with the specifiednoResultsText.Sets the no-result text of this component.
The no-result text will be displayed in popup if nothing match to the input value and can not create either, the syntax
"{0}"will be replaced with the input value at client side.- Parameters:
noResultsText- The no-result text of this component.Default:
null.- Returns:
- A modified copy of the
thisobject
-
getSeparator
Returns the separate chars of this component.Default:
null. -
withSeparator
Returns a copy ofthisimmutable component with the specifiedseparator.Sets the separate chars of this component.
Support:
0-9,A-Z(case-insensitive), and,.;'[]/\-=The separate chars will work as
Enterkey, it will be not considered as input value but sendonSearchoronSearchingwhile key up.- Parameters:
separator- The separate chars of this component.Default:
null.- Returns:
- A modified copy of the
thisobject
-
getCreateMessage
Returns the creating message of this component.Default:
null. -
withCreateMessage
Returns a copy ofthisimmutable component with the specifiedcreateMessage.Sets the creating message of this component.
The creating message will be displayed in popup if nothing match to the input value but can create as new label, the syntax
"{0}"will be replaced with the input value at client side.- Parameters:
createMessage- The creating message of this componentDefault:
null.- Returns:
- A modified copy of the
thisobject
-
isOpen
default boolean isOpen()Returns whether to open or not.Default:
folse -
withOpen
Returns a copy ofthisimmutable component with the specifiedopen.Sets whether to open or not.
- Parameters:
open-tureto open the dropdown of this component.Default:
false.- Returns:
- A modified copy of the
thisobject
-
isDisabled
default boolean isDisabled()Returns whether it is disabled.Default:
false. -
withDisabled
Returns a copy ofthisimmutable component with the specifieddisabled.Sets whether it is disabled.
- Parameters:
disabled-tureto disable this component.Default:
false.- Returns:
- A modified copy of the
thisobject
-
isCreatable
default boolean isCreatable()Returns whether creates new item by default.Default:
false.true: will show create message while value of input not exists.-
false: will show no result message while value of input not exists.
-
withCreatable
Returns a copy ofthisimmutable component with the specifiedcreatable.Sets whether creates new item by default.
true: will show create message while value of input not exists.-
false: will show no result message while value of input not exists.
- Parameters:
creatable- Whether creates new item by default.Default:
false.- Returns:
- A modified copy of the
thisobject
-
isInplace
default boolean isInplace()Return whether to display Chosenbox's selection as a comma separate label, underwithIinplace(true), when user clicks the label, it turns into a chosenbox.Default:
false -
withInplace
Returns a copy ofthisimmutable component with the specifiedinplace.Sets whether to display Chosenbox's selection as a comma separate label, under
withIinplace(true), when user clicks the label, it turns into a chosenbox.- Parameters:
inplace- Whether enables inplace-editing facility.Default:
false.- Returns:
- A modified copy of the
thisobject
-
ofId
Returns the instance with the given id.- Parameters:
id- The id to identify this component
-