cancel
Showing results for 
Search instead for 
Did you mean: 

How can I refresh the view?

Former Member
0 Kudos

Hi, Experts,

I create a component(zz_00_test_001) with two view(view1 and view2) using the WDA.

In the view1, I create a linktoaction( linktoview2 ) for nevigation view2.

Running the programe: click the line in the view1, and enter the view2. Now, I refresh the page, and hope to refresh the view2, but I found the page return the view1.

How can I solve the problem? Can you give me some hint? Thanks a lot.

Best regards,

tao

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi wang.....

the normal refresh wontwork... it goes back to the main component. what you can do is.... have a button and write your own logic like clearing all the values in the fields in it.

---regards,

alex b justin

Former Member
0 Kudos

Hi,alex,

Thanks a lot for your help.

Best regards,

tao

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

If suppose you have a input field in the view and you want to refresh this field then in wddoinit() write the following code.

Here context is ztrainid and attribute is trainid.

This hold for all UI elements.Ie the value of the attribute is set to an empty value.

DATA lo_nd_ztrainid TYPE REF TO if_wd_context_node.

DATA lo_el_ztrainid TYPE REF TO if_wd_context_element.

DATA ls_ztrainid TYPE wd_this->element_ztrainid.

DATA lv_trainid LIKE ls_ztrainid-trainid.

  • navigate from <CONTEXT> to <ZTRAINID> via lead selection

lo_nd_ztrainid = wd_context->get_child_node( name = wd_this->wdctx_ztrainid ).

  • get element via lead selection

lo_el_ztrainid = lo_nd_ztrainid->get_element( ).

CLEAR :lv_trainid .

  • get single attribute

lo_el_ztrainid->Set_attribute(

EXPORTING

name = `TRAINID`

  • IMPORTING

value = lv_trainid ).