Class TextBox
java.lang.Object
com.ptc.core.components.rendering.AbstractGuiComponent
com.ptc.core.components.rendering.guicomponents.HTMLGuiComponent
com.ptc.core.components.rendering.guicomponents.TextBox
- All Implemented Interfaces:
GuiComponent,com.ptc.netmarkets.util.misc.NmFormatable,Serializable
- Direct Known Subclasses:
SuggestTextBox
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);
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 Summary
Modifier and TypeMethodDescriptiongetId()Gets the Id of text box.intReturns the maximum Length that number of characters being entered in this text box.getValue()Returns the text box value.intgetWidth()Returns the width of text box.Checks if field has browser autocomplete enabled.booleanDetermines whether or not the given textbox is editable.voidsetBrowserAutoCompleteEnabled(Boolean browserAutoCompleteEnabled) Turns on/off browser autocomplete feature.voidsetEnabled(boolean a_Enabled) Sets the textbox as an input field or as display-text.voidSets the Id for the text box.voidsetMaxLength(int maxLength) Set the number of characters that can be entered in text box.voidSets the name property for the textbox.voidsetRequired(boolean a_required) Sets the required property true or false for textbox.voidsetTooltip(String tooltip) Sets the tooltip for the textbox.voidSet the value of the text box.voidsetWidth(int a_Width) Sets the width of the text box.Methods inherited from class com.ptc.core.components.rendering.guicomponents.HTMLGuiComponent
addJsAction, setNameQualifierMethods inherited from class com.ptc.core.components.rendering.AbstractGuiComponent
setColumnName, setLabel, setMultiValued
-
Method Details
-
getValue
Returns the text box value.
Supported API: true- Returns:
- the value of text box.
-
setValue
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
Gets the Id of text box. A string used to identify the component. Generated as the HTML id attribute.
Supported API: true- Overrides:
getIdin classAbstractGuiComponent- Returns:
- The text box identifier.
-
setId
Sets the Id for the text box. A string used to identify the component. Generated as the HTML id attribute.
Supported API: true- Overrides:
setIdin classAbstractGuiComponent- 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:
isEditablein classHTMLGuiComponent- Returns:
- boolean
-
setTooltip
Sets the tooltip for the textbox.
Supported API: true- Overrides:
setTooltipin classHTMLGuiComponent- 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:
setEnabledin classAbstractGuiComponent- 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:
setRequiredin classAbstractGuiComponent- Parameters:
a_required-
-
setName
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:
setNamein classAbstractGuiComponent- 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
Checks if field has browser autocomplete enabled.
Supported API: true- Returns:
- boolean
-
setBrowserAutoCompleteEnabled
Turns on/off browser autocomplete feature.
Supported API: true- Parameters:
browserAutoCompleteEnabled-
-