Interface ITextbox
- All Superinterfaces:
IAnyGroup<ITextbox>,IChildrenOfInputgroup<ITextbox>,IComponent<ITextbox>,IHtmlBasedComponent<ITextbox>,IInputElement<ITextbox,,String> IReadonly<ITextbox>,ITextboxBase<ITextbox>,IXulElement<ITextbox>
Textbox component
A textbox is used to let users input textual data.
You could assign value, type, constraint, rows,
cols to a textbox using the corresponding APIs. When you assign the attribute
type to a string value "password" when multiline
is false (multiline will be true if you set rows larger than 1 or set multiline
to true directly) then any character in this component will replace by '*'.
You could also assign a constraint value with a regular expression string
or a default constraint expression (available value is "no empty").
When user change the value of textbox, it will cause a validating process to validate the value
at client. If the validation fails, then a notification will pop up.
Example
@RichletMapping("/example")
public IComponent example() {
return IHlayout.of(
ITextbox.of("text..."),
ITextbox.of("secret").withType(ITextboxBase.Type.PASSWORD),
ITextbox.ofConstraint("/.+@.+\\.[a-z]+/: Please enter an e-mail address"),
ITextbox.of("text line1...\ntext line2...").withRows(5).withCols(40)
);
}- Author:
- katherine
- See Also:
-
Textbox
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classBuilds instances of typeITextbox.static classBuilds an updater of typeITextboxforUiAgent.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 client widget class.static ITextboxReturns the instance with the given value.static ITextboxofCols(int cols) Returns the instance with the given cols.static ITextboxofConstraint(String constraint) Returns the instance with the given constraint.static ITextboxReturns the instance with the given id.static ITextboxofMultiline(boolean multiline) Returns the instance with the given multiline.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.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.Textbox"- Specified by:
getWidgetClassin interfaceIComponent<ITextbox>
-
of
Returns the instance with the given value.- Parameters:
value- The textbox value
-
ofMultiline
Returns the instance with the given multiline.- Parameters:
multiline- Whether to enable multiline or not
-
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 textbox constraint
-
ofId
Returns the instance with the given id.- Parameters:
id- The id to identify this component
-