cancel
Showing results for 
Search instead for 
Did you mean: 

How to make input fields clear

Former Member
0 Kudos

Hi Friends,

I am new to WDA , so i have a basic query,

I have 2 view in my component - First and Second.

In First View, I enter some text using input fields.When i submit , same text is displayed on Second View.

When i click BACK on Second View by firing outbound plug , First View reappears.

Problem is - Same Text is displayed in Input field .I want input field to be clear for better user clarity.

Pls suggest how to clear it.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Use the method SET_ATTRIBUTE_NULL of if_wd_context_node to clear that attribute to which the Input field is bound in the respective handlers Or

You can use the SET_ATTRIBUTE method of the context node and pass the initial value ie default value

space in case of character types etc.

Regards,

Lekha.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

just bind your input field to an attribute and set that attribute as null and thus your text in input field will become null.

Regards,

Anand

Former Member
0 Kudos

Thanks all , it is resolved now.

Former Member
0 Kudos

Hi ,

clear the attributes in the method "HANDLER<inbound plug name>"of the first view. so that the fields will clear whenever this view is called.

Regards,

Naga

arjun_thakur
Active Contributor
0 Kudos

Hi Lalit,

In the ONACTIONBACK method use the following code:



DATA lo_el_context TYPE REF TO if_wd_context_element.
  DATA ls_context TYPE wd_this->element_context.
 
* get element via lead selection
  lo_el_context = wd_context->get_element( ).
 
** get single attribute
  lo_el_context->set_attribute_null(
    EXPORTING
      name =  `ABC` "ABC is the name of attribute that is binded to the input field.
 ).

I hope it helps.

Regards

Arjun

former_member40425
Contributor
0 Kudos

Hi Lalit,

Go to the properties tab of first view and change property LifeTime from framework controlled to when visible.

Surely Your problem will be resolved.

Regards,

Rohit