Text Input
Description
The TextWdg is a basic form element in which a single line of text can be entered. (To enter multiple lines, use the TextAreaWdg instead.) It maps directly to the HTML text input. It can be used independently or as an edit element in the TableLayoutWdg or EditWdg.
Info
Name |
Text Input |
Class |
pyasm.widget.TextWdg |
TACTIC Version Support |
2.5.0 |
Required database columns |
none |
Implementation
Basic example of a typical usage of a TextWdg
Options
size | Determine the width of the text widget. Default is "50". |
---|---|
read_only |
true |
Advanced
Simple example which displays text widget that is fully editable:
<element name='first_name'>
<display class='pyasm.widget.TextWdg'/>
</element>
A text widget that only allows integer input. The size is reduced to 5.
<element name='age'>
<display class='pyasm.widget.TextWdg'>
<size>5</size>
</display>
</element>
A simple example of the TextWdg in Python:
from pyasm.widget import TextWdg
div = DivWdg()
text_wdg = TextWdg("age")
text_wdg.set_option("size", "20")
div.add(text_wdg)