cancel
Showing results for 
Search instead for 
Did you mean: 

How to reset selection?

Former Member
0 Kudos

Hi ALL,

I am new to WD.I have created a WDA with two views.1st view have selection screen 2nd view displays the details.I have placed a back buttom in 2nd view and used pulgs to go back to 1st screen.

But when come back to 1st screen the selection screen is not geting refreshed.Can any one explain how to clear the selection screen in the first view when i press the back button in 2nd view.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

In the OnAction method of your back button, invalidate all your nodes that is bound to the selection screen.

Data: l_node type ref to if_wd_context_node.

l_node = wd_context->get_child_node(  'NODENAME' ).
l_node->invalidate( ).

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Anusha,

Here you need to understand and keep two things separate. One is the view and the other the context.

You use the context node and its attributes to display the data using the UI Elements in the View. So unless you change the value or write some code to change the value, the values will remain the same.

Therefore, the context is the one which holds the data. In your case, you have defined a node in the component controller. You have used this node to map with ui elements which form the Selection screen.

Now even though you are going to a different view and coming back, you have not done anything to change the values which are stored in the node and its attributes.

Hence, like Radhika suggested before you can make use of the invalidate( ) method of the interface reference if_wd_context_node.

Regards,

Rajesh

former_member40425
Contributor
0 Kudos

Hi,

Go to the properties tab of first view and change property lifetime as when visible.

Regards,

Rohit

Former Member
0 Kudos

Hi Rohit,

I have tried your solution of making the lifetime tab to whenvisible.But its not working.

Any way i got the solution.

In the on action method of your back button invalidate all your nodes that is bound to the selection screen.

Data: l_node type ref to if_wd_context_node.

l_node = wd_context->get_child_node( 'NODENAME' ).

l_node->invalidate( ).

Former Member
0 Kudos

hi,

On you Backward navigation invalidate the node <lo_nd>.

lo_nd = wd_context->get_child_node( ' NAME' ). 'Name is Context Node binded to your fields.'

lo_nd->invalidate( ).

or if you have to set the particular Attribute as null. Use this :

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 ).

Thanx.

Edited by: Saurav Mago on May 4, 2009 4:36 PM