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>
    Immutable 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
    • 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 interface IComponent<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