Package org.zkoss.stateless.sul
Interface ITextbox
-
- All Superinterfaces:
IAnyGroup<ITextbox>
,IChildrenOfInputgroup<ITextbox>
,IComponent<ITextbox>
,IHtmlBasedComponent<ITextbox>
,IInputElement<ITextbox,java.lang.String>
,IReadonly<ITextbox>
,ITextboxBase<ITextbox>
,IXulElement<ITextbox>
public interface ITextbox extends ITextboxBase<ITextbox>, IAnyGroup<ITextbox>
ImmutableTextbox
componentA 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 attributetype
to a string value"password"
whenmultiline
is false (multiline
will be true if you set rows larger than 1 or setmultiline
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 Classes Modifier and Type Interface Description static class
ITextbox.Builder
Builds instances of typeITextbox
.static class
ITextbox.Updater
Builds an updater of typeITextbox
forUiAgent.smartUpdate(Locator, SmartUpdater)
.-
Nested classes/interfaces inherited from interface org.zkoss.stateless.sul.ITextboxBase
ITextboxBase.Type
-
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description default java.lang.String
getWidgetClass()
Returns the client widget class.static ITextbox
of(java.lang.String value)
Returns the instance with the given value.static ITextbox
ofCols(int cols)
Returns the instance with the given cols.static ITextbox
ofConstraint(java.lang.String constraint)
Returns the instance with the given constraint.static ITextbox
ofId(java.lang.String id)
Returns the instance with the given id.static ITextbox
ofMultiline(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, withWidgetOverrides
-
Methods inherited from interface org.zkoss.stateless.sul.IHtmlBasedComponent
getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, withStyle, withTabindex, withTabindex, withTooltiptext, withTop, withVflex, withWidth, withZclass, withZIndex
-
Methods 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, withPlaceholder
-
Methods inherited from interface org.zkoss.stateless.sul.IReadonly
isReadonly, withReadonly
-
Methods inherited from interface org.zkoss.stateless.sul.ITextboxBase
getRows, getType, isMultiline, isSubmitByEnter, isTabbable, withMultiline, withRows, withSubmitByEnter, withTabbable, withType, withType, withValue
-
Methods inherited from interface org.zkoss.stateless.sul.IXulElement
getContext, getCtrlKeys, getPopup, getTooltip, withContext, withCtrlKeys, withPopup, withTooltip
-
-
-
-
Field Detail
-
DEFAULT
static final ITextbox DEFAULT
Constant for default attributes of this immutable component.
-
-
Method Detail
-
getWidgetClass
default java.lang.String getWidgetClass()
Returns the client widget class.Default:
"zul.inp.Textbox"
- Specified by:
getWidgetClass
in interfaceIComponent<ITextbox>
-
of
static ITextbox of(java.lang.String value)
Returns the instance with the given value.- Parameters:
value
- The textbox value
-
ofMultiline
static ITextbox ofMultiline(boolean multiline)
Returns the instance with the given multiline.- Parameters:
multiline
- Whether to enable multiline or not
-
ofCols
static ITextbox ofCols(int cols)
Returns the instance with the given cols.- Parameters:
cols
- The cols which determines the visible width
-
ofConstraint
static ITextbox ofConstraint(java.lang.String constraint)
Returns the instance with the given constraint.- Parameters:
constraint
- The textbox constraint
-
ofId
static ITextbox ofId(java.lang.String id)
Returns the instance with the given id.- Parameters:
id
- The id to identify this component
-
-