InputField
Use
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 display possible input values to users, you can define a value help for an InputField in the context attribute that is bound to the value property of this InputField. For more information, see Input Help.
Checking Required Entry Fields
A check of required entry fields is not implemented in Web Dynpro and is also not planned for the future.
-
In applications you can check whether the fields are empty. There is a method used by the application to do this.
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.
-
In applications you can check whether the required entry fields of a complete view are empty. Any personalized required entry fields are also considered.
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.
Comparison of design specification for the properties readOnly and enabled
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.
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).
Implementation Details
|
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_MD_UI_ELEMENT_REFERENCE |
No |
||
|
WDY_BOOLEAN |
false |
Yes |
|
|
WDY_BOOLEAN |
false |
Yes |
|
|
WDY_BOOLEAN |
true |
Yes |
|
|
Translatable text |
No |
||
|
WDUI_IMEMODE |
auto |
Yes |
|
| inputHelp |
WDUI_INPUTHELP |
auto |
Yes |
|
Translatable text |
Yes |
||
|
l |
20 |
Yes |
|
|
WDY_BOOLEAN |
false |
No |
|
|
WDY_BOOLEAN |
false |
Yes |
|
|
WDY_BOOLEAN |
false |
Yes |
|
|
WDUI_STATE |
normal |
Yes |
|
| styleClassName | STRING | Yes | |
|
WDUI_SUGGEST_FILTER_METHOD |
prefixSearch |
Yes |
|
|
WDY_BOOLEAN |
false |
Yes |
|
|
WDY_BOOLEAN |
false |
Yes |
|
|
WDUI_TEXT_DIRECTION |
inherit |
Yes |
|
|
Translatable text |
Yes |
||
|
Translatable text |
Mandatory |
||
|
WDUI_VISIBILITY |
visible |
Yes |
|
|
STRING |
Yes |
Events in View Designer
|
Name |
|---|
Dynamic Programming
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 |
|
|
contextMenuehaviour: 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 |
|
|
DATE_PICKER_REFERENCE_ID |
WDY_MD_UI_ELEMENT_REFERENCE |
|
|
DISPLAY_AS_TEXT |
WDY_BOOLEAN |
|
|
DISPLAY_ONLY |
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 |
|
| inputHelp | INPUT_HELP | WDUI_INPUTHELP |
| inputHelp: auto | CL_WD_INPUT_FIELD=>E_INPUT_HELP-AUTO | |
| inputHelp: calculator | CL_WD_INPUT_FIELD=>E_INPUT_HELP-CALCULATOR | |
| inputHelp: none | CL_WD_INPUT_FIELD=>E_INPUT_HELP-NONE | |
| inputHelp: search | CL_WD_INPUT_FIELD=>E_INPUT_HELP-SEARCH | |
|
INPUT_PROMPT |
WDY_MD_TRANSLATABLE_TEXT |
|
|
LENGTH |
I |
|
|
NO_HISTORY |
WDY_BOOLEAN |
|
|
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 |
|
| styleClassName | STYLE_CLASS_NAME | STRING |
|
SUGGEST_FILTER_METHOD |
WDUI_SUGGEST_FILTER_METHOD |
|
|
suggestFilterMethod: containsSearch |
CL_WD_INPUT_FIELD=>E_SUGGEST_FILTER_METHOD-CONTAINS |
|
|
suggestFilterMethod: prefixSearch |
CL_WD_INPUT_FIELD=>E_SUGGEST_FILTER_METHOD-PREFIX |
|
|
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 |
|
|
ON_TABLE_PASTE |
Example
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.