The InputField UI element allows the user to edit or display a single-line text. With an InputField you can edit any simple data type you like. The conversion from the internal format into the display format, and back into the internal format after the user has input a value, is done automatically. If, after the user has input a value into the field an error occurs during the conversion to the internal format, the value is not put back into the context, but remains in the data container. When it is next displayed, the InputField with the erroneous value is bordered in red and displayed with an error message.
The input is not checked until the roundtrip is triggered.
To enable the development of accessible applications, the label property is checked during the syntax check.
If no label has been set, and no descriptive text has been specified for the appropriate bound context element in the ABAP Dictionary, the tooltip property is checked.
Note that the value of InputField is also transferred to the password mode in plain text. For this reason applications that use the property passwordField should only run in HTTPS mode.
You can go to the HTTPS mode through an ICF service setting in transaction SICF by setting SSL as the security requirement on the Logon Data tab on the node for your application in the HTTP service tree.
For more information, see:
Suggested Values for Input Fields
Personal Value List as Dropdown List for InputFields
Example of the Display with a Label
A check of required entry fields is not implemented in Web Dynpro and is also not planned for the future.
Call the method CL_WD_DYNAMIC_TOOL=>CHECK_MANDATORY_ATTRIBUTES in your action handler or in the method wdDoBeforeAction. A example of this is the Web Dynpro application WDR_TEST_MANDATORY.
Call the method CL_WD_DYNAMIC_TOOL=>CHECK_MANDATORY_ATTR_ON_VIEW in your action handler or in the method wdDoBeforeAction. A example of this is the Web Dynpro application WDR_TEST_MANDATORY.
You should only set fields to enabled=false if these fields are not relevant for the user for his/her current work tasks, and if they are not relevant within the current context. For this reason a field with disabled=false is displayed on the screen in such a way that the user's attention is not directed to it. In this case the font of the label is displayed in grey so that it matches the hidden InputField.
Example of an InputField with enabled=false:
Read-only fields on the other hand should only be used for fields that are relevant for the user's current work tasks, and which can also be changed later, but not at this precise moment.
Data that is relevant for the current context but that can never be edited here, should currently be displayed by using a TextView. This could, however, mean that no input help can be called using the keyboard, for example, or that no field explanation can be appended (see Help Texts in and for Web Dynpro Applications).
Runtime Class |
CL_WD_INPUT_FIELD |
Properties in View Designer
Name | Type | Initial Value | Bindable |
---|---|---|---|
STRING |
(automatic) |
No |
|
WDY_BOOLEAN |
false |
No |
|
WDUI_INPUT_FIELD_ALIGNMENT |
auto |
Yes |
|
WDUI_CONTEXT_MENU_BEHAVIOUR |
inherit |
No |
|
WDY_MD_UI_ELEMENT_REFERENCE |
No |
||
WDY_BOOLEAN |
false |
Yes |
|
WDY_BOOLEAN |
true |
Yes |
|
Translatable text |
No |
||
WDUI_IMEMODE |
auto |
Yes |
|
Translatable text |
Yes |
||
I |
20 |
Yes |
|
WDY_BOOLEAN |
false |
Yes |
|
WDY_BOOLEAN |
false |
Yes |
|
WDUI_STATE |
normal |
Yes |
|
WDY_BOOLEAN |
false |
No |
|
WDUI_TEXT_DIRECTION |
inherit |
Yes |
|
Translatable text |
Yes |
||
Translatable text |
Mandatory |
||
WDUI_VISIBILITY |
visible |
Yes |
|
STRING |
Yes |
Events in View Designer
Name |
---|
Other properties that can be inherited are defined in the related higher-level classes. The related UI elements are:
For dynamic programming, the same properties, events, and aggregations as in the View Designer are available. But note that the spelling format and use of upper/lower case is different.
Dynamic Programming of Properties
View Designer Name | Runtime Name | Type |
---|---|---|
ACTIVATE_ACCESS_KEY |
WDY_BOOLEAN |
|
ALIGNMENT |
WDUI_INPUT_FIELD_ALIGNMENT |
|
alignment: auto |
CL_WD_INPUT_FIELD=>E_ALIGNMENT-AUTO |
|
alignment: beginOfLine |
CL_WD_INPUT_FIELD=>E_ALIGNMENT-BEGIN_OF_LINE |
|
alignment: center |
CL_WD_INPUT_FIELD=>E_ALIGNMENT-CENTER |
|
alignment: endOfLine |
CL_WD_INPUT_FIELD=>E_ALIGNMENT-END_OF_LINE |
|
alignment: forcedLeft |
CL_WD_INPUT_FIELD=>E_ALIGNMENT-FORCED_LEFT |
|
alignment: forcedRight |
CL_WD_INPUT_FIELD=>E_ALIGNMENT-FORCED_RIGHT |
|
CONTEXT_MENU_BEHAVIOUR |
WDUI_CONTEXT_MENU_BEHAVIOUR |
|
contextMenuBehaviour: inherit |
CL_WD_INPUT_FIELD=>E_CONTEXT_MENU_BEHAVIOUR-INHERIT |
|
contextMenuBehaviour: provide |
CL_WD_INPUT_FIELD=>E_CONTEXT_MENU_BEHAVIOUR-PROVIDE |
|
contextMenuBehaviour: suppress |
CL_WD_INPUT_FIELD=>E_CONTEXT_MENU_BEHAVIOUR-SUPPRESS |
|
CONTEXT_MENU_ID |
WDY_MD_UI_ELEMENT_REFERENCE |
|
DISPLAY_AS_TEXT |
WDY_BOOLEAN |
|
ENABLED |
WDY_BOOLEAN |
|
EXPLANATION |
WDY_MD_TRANSLATABLE_TEXT |
|
IME_MODE |
WDUI_IMEMODE |
|
imeMode: active |
CL_WD_INPUT_FIELD=>E_IME_MODE-ACTIVE |
|
imeMode: auto |
CL_WD_INPUT_FIELD=>E_IME_MODE-AUTO |
|
imeMode: disabled |
CL_WD_INPUT_FIELD=>E_IME_MODE-DISABLED |
|
imeMode: inactive |
CL_WD_INPUT_FIELD=>E_IME_MODE-INACTIVE |
|
INPUT_PROMPT |
WDY_MD_TRANSLATABLE_TEXT |
|
LENGTH |
I |
|
PASSWORD_FIELD |
WDY_BOOLEAN |
|
READ_ONLY |
WDY_BOOLEAN |
|
STATE |
WDUI_STATE |
|
state: normal |
CL_WD_INPUT_FIELD=>E_STATE-NORMAL |
|
state: required |
CL_WD_INPUT_FIELD=>E_STATE-REQUIRED |
|
SUGGEST_VALUES |
WDY_BOOLEAN |
|
TEXT_DIRECTION |
WDUI_TEXT_DIRECTION |
|
textDirection inherit |
CL_WD_INPUT_FIELD=>E_TEXT_DIRECTION-INHERIT |
|
textDirection ltr |
CL_WD_INPUT_FIELD=>E_TEXT_DIRECTION-LTR |
|
textDirection rtl |
CL_WD_INPUT_FIELD=>E_TEXT_DIRECTION-RTL |
|
TOOLTIP |
WDY_MD_TRANSLATABLE_TEXT |
|
VALUE |
WDY_MD_TRANSLATABLE_TEXT |
|
VISIBLE |
WDUI_VISIBILITY |
|
visible: none |
CL_WD_INPUT_FIELD=>E_VISIBLE-NONE |
|
visible: visible |
CL_WD_INPUT_FIELD=>E_VISIBLE-VISIBLE |
|
WIDTH |
STRING |
Dynamic Programming of Events
View Designer Name | Runtime Name |
---|---|
ON_ENTER |
You can find examples of this interface element in the system in the WDR_TEST_UI_ELEMENTS Web Dynpro application and in the WDR_TEST_EVENTS component in the InputField view.