A multiline region for displaying and editing text. Text in the control is restricted to a single font, size and style unless set with HTML commands. For sophisticated test editing see control htmlEdit.
The textEdit control has a frame. The size of the frame is defined by the 'rows' and 'cols' attribute. A vertical scrollbar is displayed permanently. The scroll bar is enabled when the number of lines exceeds the 'rows' attribute.
If the 'wrapping' attribute is not "OFF" the text is wrapped according to the 'cols' attribute - no horizontal scrollbar. If 'wrapping' is set to "OFF" a horizontal scrollbar is activated if the text line length exceeds the width set by the 'cols' attribute.
cols
Defines width of the textEdit control in characters. If the text line exceeds the width defined with the 'cols' attribute and the 'wrapping' attribute if "OFF" a horizontal scrollbar is activated. The scrollbar is appended to the textEdit frame, so that the 'rows' attribute stays unchanged.
If 'wrapping' is set to "HARD" or "SOFT" the text line is wrapped and no horizontal scrollbar is activated.
Be aware that the definition of 'cols' by characters is only an approach and varies by the used character font. A character font with unequal spacing shows different results. A i character fits more often into the textEdit field than a m character.
enabled
A boolean value that enables or disables the textEdit control. A disabled label has a different text color to show the user that it is disabled.
height
Set the height of the text edit control.
id
Identification name of the textEdit.
labeled
Enables or disables the notification when the control has a label assigned to it.
rows
Defines the height of the textEdit control in lines. If the text lines exceed the 'rows' attribute the vertical scrollbar becomes active.
text
Defines the string of text displayed. This text can be edited and/or new text can be added.
tooltip
Defines the hint of the textEdit which is displayed as the mouse cursor passes over the textEdit, or as the mouse button is pressed but not released.
width
Set the width of the text edit control.
wrapping
Controls the text flow. "HARD" and "SOFT" are passed on to the HTML-Output and control how the carriage return is handled. Web clients handle text wrapping differently. Therefor the following description cannot be guaranteed on all web clients.
HARD
Wraps the text at the width set by the 'cols' attribute. A carriage control is transmitted at every line break.
No horizontal scrollbar is displayed.
SOFT
Wraps the text at the width set by the 'cols' attribute. No carriage control is transmitted.
No horizontal scrollbar is displayed.
OFF
The text line is not wrapped. If the text line length exceeds the width set by the 'cols' attribute a horizontal scrollbar is displayed.
Attributes |
M |
Values |
Usage |
---|---|---|---|
cols |
Numeric (35) |
Taglib cols="20" Classlib setCols("20") |
|
enabled |
FALSE TRUE (d) |
Taglib No tag available Classlib setEnabled(true) |
|
height |
Unit |
Taglib No tag available Classlib setHeight("300px") |
|
id |
* |
String (cs) |
Taglib id="Edit_text" Classlib setId("Edit_text") |
labeled |
FALSE (d) TRUE |
Taglib No tag available Classlib setLabeled(true) |
|
rows |
Numeric (5) |
Taglib rows="10" Classlib setRows(10) |
|
text |
String |
Taglib text="editable text" Classlib setText("editable text") |
|
tooltip |
String |
Taglib tooltip="PDK document" Classlib setTooltip("PDK document") |
|
wrapping |
HARD (d) SOFT OFF |
Taglib wrapping="OFF" Classlib setWrapping(TextWrapping.SOFT) |
using the taglib
Syntax
<hbj:textEdit id="Edit_Text text="Text to change - or just add text" wrapping="SOFT" tooltip="Edit and/or add text" rows="10" cols="30" />
using the classlib
Syntax
Form form = (Form) this.getForm(); TextEdit te = new TextEdit("Edit_Text"); te.setText("Text to change - or just add text"); te.setWrapping(TextWrapping.SOFT); te.setTooltip("Edit and/or add text"); te.setRows(10); te.setCols(30); form.addComponent(te);