Package org.zkoss.zul

Class Bandbox

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, Component, Disable, Readonly, Scope, ComponentCtrl, Constrainted

    public class Bandbox
    extends Textbox
    A band box. A bank box consists of an input box (Textbox and a popup window Bandpopup. It is similar to Combobox except the popup window could have any kind of children. For example, you could place a textbox in the popup to let user search particular items.

    Default getZclass(): z-bandbox.(since 3.5.0)

    Events: onOpen
    Developers can listen to the onOpen event and initializes it when OpenEvent.isOpen() is true, and/or clean up if false.

    Note: to have better performance, onOpen is sent only if a non-deferrable event listener is registered (see Deferrable).

    Author:
    tomyeh
    See Also:
    Serialized Form
    • Method Detail

      • getDropdown

        public Bandpopup getDropdown()
        Returns the dropdown window belonging to this band box.
      • isAutodrop

        public boolean isAutodrop()
        Returns whether to automatically drop the list if users is changing this text box.

        Default: false.

      • setAutodrop

        public void setAutodrop​(boolean autodrop)
        Sets whether to automatically drop the list if users is changing this text box.
      • isButtonVisible

        public boolean isButtonVisible()
        Returns whether the button (on the right of the textbox) is visible.

        Default: true.

      • setButtonVisible

        public void setButtonVisible​(boolean visible)
        Sets whether the button (on the right of the textbox) is visible.
      • isOpen

        public boolean isOpen()
        Returns whether this bandbox is open.

        Default: false.

        Since:
        6.0.0
      • setOpen

        public void setOpen​(boolean open)
        Sets to display dropdown or close the child. Only works while visible.
        Since:
        3.0.1
      • open

        public void open()
        Drops down the child. The same as setOpen(true).
        Since:
        3.0.1
      • close

        public void close()
        Closes the child if it was dropped down. The same as setOpen(false).
        Since:
        3.0.1
      • setMultiline

        public void setMultiline​(boolean multiline)
        Bandbox can't be enabled the multiline functionality.
        Overrides:
        setMultiline in class Textbox
      • setRows

        public void setRows​(int rows)
        Bandbox can't be enabled the rows functionality.
        Overrides:
        setRows in class Textbox
      • setIconSclass

        public void setIconSclass​(java.lang.String iconSclass)
        Sets the iconSclass name of this Bandbox.
        Parameters:
        iconSclass - String
        Since:
        8.6.2
      • getIconSclass

        public java.lang.String getIconSclass()
        Returns the iconSclass name of this Bandbox.
        Returns:
        the iconSclass name
        Since:
        8.6.2
      • getPopupWidth

        public java.lang.String getPopupWidth()
        Returns:
        the width of the popup of this component
        Since:
        8.0.3
      • setPopupWidth

        public void setPopupWidth​(java.lang.String popupWidth)
        Sets the width of the popup of this component. If the input is a percentage, the popup width will be calculated by multiplying the width of this component with the percentage. (e.g. if the input string is 130%, and the width of this component is 300px, the popup width will be 390px = 300px * 130%) Others will be set directly.
        Parameters:
        popupWidth - the width of the popup of this component
        Since:
        8.0.3