Class TextInput
java.lang.Object
io.mindspice.simplypages.core.HtmlTag
io.mindspice.simplypages.components.forms.TextInput
- All Implemented Interfaces:
Component
Single-line input control.
Mutable and not thread-safe. Mutators update this element instance in place. Mutate within a request-scoped flow. For reuse, stop mutating and render as a stable structure with per-request slot/context values.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSupported input types mapped to HTMLtype. -
Field Summary
Fields inherited from class HtmlTag
attributes, children, id, innerText, innerTextSlot, selfClosing, tagName, trustedHtml -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TextInputCreates a text input.static TextInputCreates a date input.disabled()Marks input disabled.static TextInputCreates an email input.static TextInputCreates a number input.static TextInputCreates a password input.readonly()Marks input readonly.required()Marks input required.static TextInputCreates a search input.withAutocomplete(String value) Sets autocomplete attribute.Sets autofocus attribute.Appends class token(s).Sets id attribute.Sets HTMLmaxvalue.withMaxLength(int maxLength) Sets maximum text length.withMaxWidth(String maxWidth) Sets inline max-width style.Sets HTMLminvalue.withMinLength(int minLength) Sets minimum text length.withMinWidth(String minWidth) Sets inline min-width style.withPattern(String pattern) Sets HTMLpattern.withPlaceholder(String placeholder) Sets placeholder attribute.Sets HTMLstep.withType(TextInput.InputType type) Sets input type.Sets value attribute.Sets inline width style.Methods inherited from class HtmlTag
addClass, addStyle, addTrustedStyle, getChildrenStream, getId, hxDelete, hxGet, hxInclude, hxPatch, hxPost, hxPushUrl, hxPut, hxScrollTargetTop, hxSwap, hxTarget, hxTrigger, render, withAttribute, withChild, withInnerText, withInnerText, withUnsafeHtml
-
Constructor Details
-
TextInput
Creates a text input with default typetext.- Parameters:
name- form field name
-
-
Method Details
-
create
-
email
-
password
-
number
-
date
-
search
-
withType
Sets input type.- Parameters:
type- input type enum- Returns:
- this input
-
withId
-
withValue
-
withPlaceholder
-
required
-
readonly
-
disabled
-
withPattern
-
withMinLength
Sets minimum text length.- Parameters:
minLength- minimum length- Returns:
- this input
-
withMaxLength
Sets maximum text length.- Parameters:
maxLength- maximum length- Returns:
- this input
-
withMin
-
withMax
-
withStep
-
withClass
-
withAutofocus
-
withAutocomplete
-
withWidth
-
withMaxWidth
Sets inline max-width style.- Overrides:
withMaxWidthin classHtmlTag- Parameters:
maxWidth- CSS max-width value- Returns:
- this input
-
withMinWidth
Sets inline min-width style.- Overrides:
withMinWidthin classHtmlTag- Parameters:
minWidth- CSS min-width value- Returns:
- this input
-