on 04-03-2012 8:35 AM
Hi Abapers,
I am just learning webdynpro. I have a doubt in tutorial 3. when i click on button 'New Search' in view no_filghts_view i am still able to see my previous values in the view FLIGHTLISTVIEW. i just want to blank those fields CITY and CITY1.
what is the best an efficient way to do that.
I had succesfully refreshed writing the code in the method WDDOBEFOREACTION. Is this method calling set_attribute is efficient or is there any other method to refresh all the fields in the context.
DATA lo_nd_destination_from_1 TYPE REF TO if_wd_context_node.
DATA lo_el_destination_from_1 TYPE REF TO if_wd_context_element.
DATA ls_destination_from_1 TYPE wd_this->element_destination_from_1.
DATA lv_city TYPE wd_this->element_destination_from_1-city.
* navigate from <CONTEXT> to <DESTINATION_FROM_1> via lead selection
lo_nd_destination_from_1 = wd_context->get_child_node( name = wd_this->wdctx_destination_from_1 ).
* get element via lead selection
lo_el_destination_from_1 = lo_nd_destination_from_1->get_element( ).
* set single attribute
lo_el_destination_from_1->set_attribute(
name = `CITY`
value = lv_city ).
* navigate from <CONTEXT> to <DESTINATION_FROM_1> via lead selection
lo_nd_destination_from_1 = wd_context->get_child_node( name = wd_this->wdctx_destination_to_1 ).
* get element via lead selection
lo_el_destination_from_1 = lo_nd_destination_from_1->get_element( ).
* set single attribute
lo_el_destination_from_1->set_attribute(
name = `CITY`
value = lv_city ).
endmethod.
Please reply to those 2 questions.
Thanks
Invalidating the node is the best way to Reset the values.
Thanks,
Raju Bonagiri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Guys....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Kiran and Raju for your replies . correct me if i am wrong - if want to clear all elements at once under context use invalidating. If only some of the elements needs clearing then u need to use set_attribute with blank value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Using set_attribute( ) method and passing empty value is one way., else you can use invalidate( ) method of node to clear all fields under that node.,
like
node->invalidate( ).
ex:
DATA lo_nd_destination_from_1 TYPE REF TO if_wd_context_node.
* navigate from <CONTEXT> to <DESTINATION_FROM_1> via lead selection
lo_nd_destination_from_1 = wd_context->get_child_node( name = wd_this->wdctx_destination_from_1 ).
lo_nd_destination_from_1->invalidate( ).
Hope this helps u.,
Thanks & Regards,
Kiran.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.