Class TextArea

java.lang.Object
io.mindspice.simplypages.core.HtmlTag
io.mindspice.simplypages.components.forms.TextArea
All Implemented Interfaces:
Component

public class TextArea extends HtmlTag
Multi-line text input control.

Mutable and not thread-safe. Mutators update this 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.

  • Constructor Details

    • TextArea

      public TextArea(String name)
      Creates a textarea with required field name.
      Parameters:
      name - form field name
  • Method Details

    • create

      public static TextArea create(String name)
      Creates a textarea.
      Parameters:
      name - form field name
      Returns:
      new textarea
    • withId

      public TextArea withId(String id)
      Sets id attribute.
      Overrides:
      withId in class HtmlTag
      Parameters:
      id - element id
      Returns:
      this textarea
    • withValue

      public TextArea withValue(String value)
      Replaces textarea content.
      Parameters:
      value - textarea content
      Returns:
      this textarea
    • withPlaceholder

      public TextArea withPlaceholder(String placeholder)
      Sets placeholder attribute.
      Parameters:
      placeholder - placeholder text
      Returns:
      this textarea
    • withRows

      public TextArea withRows(int rows)
      Sets rows attribute.
      Parameters:
      rows - row count
      Returns:
      this textarea
    • withCols

      public TextArea withCols(int cols)
      Sets cols attribute.
      Parameters:
      cols - column count
      Returns:
      this textarea
    • required

      public TextArea required()
      Marks textarea required.
      Returns:
      this textarea
    • readonly

      public TextArea readonly()
      Marks textarea readonly.
      Returns:
      this textarea
    • disabled

      public TextArea disabled()
      Marks textarea disabled.
      Returns:
      this textarea
    • withMaxLength

      public TextArea withMaxLength(int maxLength)
      Sets maximum allowed character count.
      Parameters:
      maxLength - max length
      Returns:
      this textarea
    • withMinLength

      public TextArea withMinLength(int minLength)
      Sets minimum required character count.
      Parameters:
      minLength - min length
      Returns:
      this textarea
    • withClass

      public TextArea withClass(String className)
      Replaces class attribute with form-textarea <className>.
      Overrides:
      withClass in class HtmlTag
      Parameters:
      className - additional classes
      Returns:
      this textarea
    • withAutofocus

      public TextArea withAutofocus()
      Sets autofocus attribute.
      Returns:
      this textarea
    • withWrap

      public TextArea withWrap(String wrap)
      Sets wrap behavior.
      Parameters:
      wrap - wrap mode token
      Returns:
      this textarea
    • withWidth

      public TextArea withWidth(String width)
      Sets inline width style.
      Overrides:
      withWidth in class HtmlTag
      Parameters:
      width - CSS width value
      Returns:
      this textarea
    • withMaxWidth

      public TextArea withMaxWidth(String maxWidth)
      Sets inline max-width style.
      Overrides:
      withMaxWidth in class HtmlTag
      Parameters:
      maxWidth - CSS max-width value
      Returns:
      this textarea
    • withMinWidth

      public TextArea withMinWidth(String minWidth)
      Sets inline min-width style.
      Overrides:
      withMinWidth in class HtmlTag
      Parameters:
      minWidth - CSS min-width value
      Returns:
      this textarea