This document will walk you through :
The concept of making a UI-element Mandatory(Required)/Non mandatory in a web dynpro component using "State" Property.
*********************************************************************************************************************************************************************
Assumption :
1. You have created a web dynpro application .
2. You have created the UI elements "Field1" in the view of the component , which you have to make mandatory/optional based on your requirement. .
Procedure :
Step 1 : Create a Attribute in the context of the view with type "WDUI_STATE" lets say i have created "field1_state".
Step 2 : Bind the property "State" of the Field1 with "field1_state" (context attribute created in step 1 ).
Step 3 : Now based on your requirement , place the below code in the appropriate method for making the Field1 as mandatory(with red astrik) .
DATA lo_el_context TYPE REF TO if_wd_context_element.
lo_el_context->set_attribute(
name = `field1_enabled`
value = '01' ).
Step 4 : Same way place the below code in the appropriate method for making the field1as non mandatory (Normal item).
DATA lo_el_context TYPE REF TO if_wd_context_element
lo_el_context
->set_attribute(.
Please let me if more clarification is required.
Thanks,
Gejo john.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 | |
4 | |
3 | |
3 |