Package com.groiss.gui.component
Class Textfield
java.lang.Object
com.groiss.gui.AbstractComponent
com.groiss.gui.component.Textfield
- All Implemented Interfaces:
Component
,Serializable
,Cloneable
- Direct Known Subclasses:
HiddenField
,PasswordField
The Textfield component is used for a single line text entry fields.
- See Also:
-
Field Summary
Fields inherited from class com.groiss.gui.AbstractComponent
ACTIVE, browserMode, DEFAULT, ID, IE, INVISIBLE, isSensitive, label, NS, ON_BLUR, ON_CHANGE, ON_CLICK, ON_DBLCLICK, ON_FOCUS, ON_KEY_DOWN, ON_KEY_PRESS, ON_KEY_UP, ON_LOAD, ON_MOUSE_DOWN, ON_MOUSE_MOVE, ON_MOUSE_OUT, ON_MOUSE_UP, ON_RESET, ON_SELECT, ON_SUBMIT, ON_UNLOAD, parent, parentElem, READONLY, root, viewMode
Fields inherited from interface com.groiss.gui.Component
LABELLEDBY
-
Constructor Summary
ConstructorDescriptionConstructs a new empty Textfield component.Constructor with name and value.Constructor with name, value maxlength and sizeConstructor with name and value. -
Method Summary
Modifier and TypeMethodDescriptionGet the value.int
int
getSize()
getValue()
void
setContent
(Object o) Set the value attribute.void
setMaxlength
(int length) sets the maximum length of the text in the textfieldvoid
setSize
(int size) sets the size of the textfieldvoid
sets the initial displayed value of the fieldMethods inherited from class com.groiss.gui.AbstractComponent
addClass, clone, create, getAttribute, getBrowserMode, getId, getLabel, getName, getParent, getParentElement, getRoot, getRootName, getStyle, getViewMode, init, init, init, removeAttribute, removeClass, setActionListener, setAttribute, setBrowserMode, setClass, setEncoding, setExpandEmptyElements, setId, setIndenting, setLabel, setName, setNewLines, setParent, setParentElement, setRootName, setStyle, setViewMode, show, show, toggleClass, toString
-
Constructor Details
-
Textfield
public Textfield()Constructs a new empty Textfield component. -
Textfield
-
Textfield
-
Textfield
-
Textfield
Constructor with name and value.- Parameters:
name
- the name and id of the field.value
- the value of the field
-
Textfield
Constructor with name and value.- Parameters:
name
- the group where the field belongs tovalue
- the value of the fieldstyleClass
- the name of a CSS class
-
Textfield
Constructor with name, value maxlength and size- Parameters:
name
- the group where the text field belongs tovalue
- the value of the text fieldmaxlength
- the maximum length of the contentsize
- the size of the field
-
-
Method Details
-
setMaxlength
public void setMaxlength(int length) sets the maximum length of the text in the textfield- Parameters:
length
- - the maximum length
-
getMaxlength
public int getMaxlength() -
setSize
public void setSize(int size) sets the size of the textfield- Parameters:
size
- - the size of the input field
-
getSize
public int getSize() -
setValue
sets the initial displayed value of the field- Parameters:
value
- - the value
-
getValue
-
setContent
Set the value attribute.- Specified by:
setContent
in interfaceComponent
- Overrides:
setContent
in classAbstractComponent
- Parameters:
o
- any object where the string representation is used for rendering
-
getContent
Get the value.- Specified by:
getContent
in interfaceComponent
- Overrides:
getContent
in classAbstractComponent
- Returns:
- the value attribute
-