TextField is used to input and display text data of different formats in a single line of text. |
|
TextField inserted in a GridPanel as seen in Lycia Form Designer: |
Form XML code:
<TextField visible="true" identifier="f1"/>
Theme element filter XML code:
<ElementFilter ElementName="TextField">
...
</ElementFilter>
CSS element selector code:
qx-aum-text-field
.qx-aum-text-field .qx-text ↓
Associated 4gl syntax:
Most commonly used form properties:
Most commonly used theme properties:
Font:
Inheritance diagram:
Associated ui methods:
SetText →
GetText
SetInvisibleValue →
GetInvisibleValue
SetIsPasswordMask →
SetIsPasswordMask
SetMaxLength →
GetMaxLength →
SetToCase →
GetToCase →
Create
ForName
Influence and behavior:
To add a text field to your form,
Step 1 |
Choose a textField from the widgets palette by left-clicking its icon:
|
Step 2 |
Select the place in the form where you want to put the text field (in the screenshot below, we choose a cell in a Grid panel):
|
Step 3 |
Left-click the selected spot (cell or sector) to place the text field there:
|
|
The text field is now added to your form, and you can see it in the Structure view.
|
Here you can find out how to change the initial text displayed to the text field in the form:
|
Here you can find out how to change the text displayed to the text field at runtime using ui methods or DISPLAY ... TO statement.
Here you can find out how to input text to text fields using the INPUT statement, e.g.:
INPUT BY NAME f1 WITHOUT DEFAULTS
You can change appearance properties of a text field in Lycia Form Designer. However, we recommend applying appearance properties via user themes and css.
To apply a property to a text field, set its value in the user theme, directly or using filters.
In the example below, we change the font used to display text to a definite text field by applying New Font property with a With ID... filter.
property applied in the user theme |
|
theme XML code |
<?xml version="1.0" encoding="utf-8"?> <StyleSheet xmlns="http://querix.com"> <ElementFilter ElementName="TextField"> <StyleSheet> <ElementIdFilter Identifier="f1"> <StyleSheet> <DoStyleAction> <SetProperty> <PropertyPath> <PropertyName>Font</PropertyName> </PropertyPath> <PropertyValue type="Font" Bold="True" FontSize="20"> <Family> <Name>Cambria</Name> </Family> </PropertyValue> </SetProperty> </DoStyleAction> </StyleSheet> </ElementIdFilter> <ElementIdFilter Identifier="f2"> <StyleSheet> <DoStyleAction> <SetProperty> <PropertyPath> <PropertyName>Font</PropertyName> </PropertyPath> <PropertyValue type="Font" Italic="True" FontSize="12"> <Family> <Name>Courier New</Name> </Family> </PropertyValue> </SetProperty> </DoStyleAction> </StyleSheet> </ElementIdFilter> </StyleSheet> </ElementFilter> </StyleSheet> |
runtime appearance |
In the example below, we use css to change the text style of the button:
.qx-aum-text-field .qx-text {
padding: 2px;
padding: 5px 10px;
color: white !important;
font: bold 14px "Calibri","Helvetica Neue", Sans-Serif;
}
At runtime, text fields can be manipulated with ui methods.
Here you can find out how to change the case of the input text using the setToCase method:
Here you can find out how to make the input values invisible by using the setInvisibleValue method:
Here you can find out how to make the input values invisible by using the setIsPasswordMask method:
Related articles: