Package org.zkoss.zul

Class Textbox

    • Method Detail

      • setValue

        public void setValue​(java.lang.String value)
                      throws WrongValueException
        Sets the value.
        Parameters:
        value - the value; If null, it is considered as empty.
        Throws:
        WrongValueException - if value is wrong
      • getType

        public java.lang.String getType()
        Returns the type.

        Default: text.

        Overrides:
        getType in class InputElement
      • setType

        public void setType​(java.lang.String type)
                     throws WrongValueException
        Sets the type.
        Parameters:
        type - the type. Acceptable values are "text" and "password". Unlike XUL, "timed" is redundant because it is enabled as long as onChanging is added. Since 6.5.0 type also support tel, email and url.
        Throws:
        WrongValueException
      • getRows

        public int getRows()
        Returns the rows.

        Default: 1.

      • checkBeforeSetRows

        protected void checkBeforeSetRows()
                                   throws UiException
        Internal check if there is any use of vflex and height before setRows
        Throws:
        UiException
      • isMultiline

        public boolean isMultiline()
        Returns whether it is multiline.

        Default: false.

        Overrides:
        isMultiline in class InputElement
      • setMultiline

        public void setMultiline​(boolean multiline)
        Sets whether it is multiline.
      • isTabbable

        public boolean isTabbable()
        Returns whether TAB is allowed. If true, the user can enter TAB in the textbox, rather than change focus.

        Default: false.

        Since:
        3.6.0
      • setTabbable

        public void setTabbable​(boolean tabbable)
        Sets whether TAB is allowed. If true, the user can enter TAB in the textbox, rather than change focus.

        Default: false.

        Since:
        3.6.0
      • isSubmitByEnter

        public boolean isSubmitByEnter()
        Returns whether it is submitByEnter, If submitByEnter is true, press enter will fire onOK event instead of move to next line, you should press shift + enter if you want to move to next line.

        Default: false.

        Returns:
        true if it is submitByEnter.
        Since:
        8.5.2
      • setSubmitByEnter

        public void setSubmitByEnter​(boolean submitByEnter)
        Sets whether it is submitByEnter. If submitByEnter is true, press enter will fire onOK event instead of move to next line, you should press shift + enter if you want to move to next line.
        Parameters:
        submitByEnter - whether it is submitByEnter
        Since:
        8.5.2
      • setVflex

        public void setVflex​(java.lang.String flex)
        Description copied from class: HtmlBasedComponent
        Sets vertical flexibility hint of this component.

        Number flex indicates how this component's container distributes remaining empty space among its children vertically. Flexible component grow and shrink to fit their given space. Flexible components with larger flex values will be made larger than components with lower flex values, at the ratio determined by all flexible components. The actual flex value is not relevant unless there are other flexible components within the same container. Once the default sizes of components in a container are calculated, the remaining space in the container is divided among the flexible components, according to their flex ratios.

        Specify a flex value of negative value, 0, or "false" has the same effect as leaving the flex attribute out entirely. Specify a flex value of "true" has the same effect as a flex value of 1.

        Special flex hint, "min", indicates that the minimum space shall be given to this flexible component to enclose all of its children components. That is, the flexible component grow and shrink to fit its children components.

        Overrides:
        setVflex in class HtmlBasedComponent
        Parameters:
        flex - the vertical flex hint.
        See Also:
        HtmlBasedComponent.setHflex(java.lang.String), HtmlBasedComponent.getVflex()
      • clone

        public java.lang.Object clone()
        Description copied from interface: Component
        Clones the component. All of its children and descendants are cloned. Also, ID are preserved.
        Specified by:
        clone in interface Component
        Overrides:
        clone in class InputElement
        Returns:
        the new component. Notice that it doesn't belong to any page, nor desktop. It doesn't have a parent, either.
      • getPropertyAccess

        public PropertyAccess getPropertyAccess​(java.lang.String prop)
        Description copied from interface: ComponentCtrl
        Returns the corresponding property access object from the given property name, if any.
        Specified by:
        getPropertyAccess in interface ComponentCtrl
        Overrides:
        getPropertyAccess in class InputElement
        Parameters:
        prop - the name of the property
        Returns:
        null it means not to support for the property name.