All Implemented Interfaces:
GuiComponent, com.ptc.netmarkets.util.misc.NmFormatable, Serializable
Direct Known Subclasses:
SuggestTextBox

public class TextBox extends HTMLGuiComponent
A simple GUI component that represents a HTML textbox. Note that this component is not intended for use in situations that need "wrap" behavior. Use TextArea for such cases instead.

Supported API: true

Extendable: false

Example :

private final int MAX_LENGTH = 30;

TextBox textbox = new TextBox();
textbox.setId("text1Id");
textbox.setName("text1Name");
textbox.setValue("Hello World");
textbox.setWidth(4);
textbox.setMaxLength(MAX_LENGTH);
textbox.setTooltip("This is a Text Box");
textbox.setBrowserAutoCompleteEnabled(false);

See Also:
  • Method Details

    • getValue

      public String getValue()
      Returns the text box value.

      Supported API: true
      Returns:
      the value of text box.
    • setValue

      public void setValue(String a_Value)
      Set the value of the text box.

      Supported API: true
      Parameters:
      a_Value - The value.
    • getWidth

      public int getWidth()
      Returns the width of text box. Default width is 10. width should be > 0

      Supported API: true
      Returns:
      the width of text box.
    • setWidth

      public void setWidth(int a_Width)
      Sets the width of the text box. Default width is 10. width should be > 0 If width is smaller than content you will see content scrolls when we type in the text box.

      Supported API: true
      Parameters:
      a_Width -
    • getId

      public String getId()
      Gets the Id of text box. A string used to identify the component. Generated as the HTML id attribute.

      Supported API: true
      Overrides:
      getId in class AbstractGuiComponent
      Returns:
      The text box identifier.
    • setId

      public void setId(String eyeD)
      Sets the Id for the text box. A string used to identify the component. Generated as the HTML id attribute.

      Supported API: true
      Overrides:
      setId in class AbstractGuiComponent
      Parameters:
      eyeD - The text box identifier.
    • isEditable

      public boolean isEditable()
      Determines whether or not the given textbox is editable. Default is true; allows editing of the input field. if set as false; makes the input field non-editable.

      Supported API: true
      Overrides:
      isEditable in class HTMLGuiComponent
      Returns:
      boolean
    • setTooltip

      public void setTooltip(String tooltip)
      Sets the tooltip for the textbox.

      Supported API: true
      Overrides:
      setTooltip in class HTMLGuiComponent
      Parameters:
      tooltip - The tooltip to set for the textbox.
    • setEnabled

      public void setEnabled(boolean a_Enabled)
      Sets the textbox as an input field or as display-text. Default is true; renders the textbox as an input field. if set as false; renders the textbox as display-text (does not render an input field)

      Supported API: true
      Overrides:
      setEnabled in class AbstractGuiComponent
      Parameters:
      a_Enabled -
    • setRequired

      public void setRequired(boolean a_required)
      Sets the required property true or false for textbox. Default is false. If the given value is true, the textbox marked as required field.

      Supported API: true
      Overrides:
      setRequired in class AbstractGuiComponent
      Parameters:
      a_required -
    • setName

      public void setName(String n)
      Sets the name property for the textbox. Can be used to set textbox name. Default will be set to the row object's OID, if applicable.

      Supported API: true
      Overrides:
      setName in class AbstractGuiComponent
      Parameters:
      n -
    • getMaxLength

      public int getMaxLength()
      Returns the maximum Length that number of characters being entered in this text box. Default is no limit.

      Supported API: true
      Returns:
      Maximum length of text box.
    • setMaxLength

      public void setMaxLength(int maxLength)
      Set the number of characters that can be entered in text box. Default is no limit.

      Supported API: true
      Parameters:
      maxLength -
    • isBrowserAutoCompleteEnabled

      public Boolean isBrowserAutoCompleteEnabled()
      Checks if field has browser autocomplete enabled.

      Supported API: true
      Returns:
      boolean
    • setBrowserAutoCompleteEnabled

      public void setBrowserAutoCompleteEnabled(Boolean browserAutoCompleteEnabled)
      Turns on/off browser autocomplete feature.

      Supported API: true
      Parameters:
      browserAutoCompleteEnabled -