cancel
Showing results for 
Search instead for 
Did you mean: 

How to reload a web dynpro application using action similar to f5 in browser

Former Member
0 Kudos

Hii Experts

I want to  Relaod Web dynpro component though button on view. Which should work similar to F5.

When ever user click on button entire application should reloaded.

I have created a button on view 'Refresh' and the action attached to it is 'onactionrefresh'.

Please help me what code should I write within actionrefresh. So that my application will reload.

I try many ways but not working like   wd_comp_controller->invalidate( ) .


node-> invlidate( )


I saw a note  using exit plug url but it was not clear.


Please help me its urgent                                                        

Accepted Solutions (1)

Accepted Solutions (1)

Harsh_Bansal
Contributor
0 Kudos

Hi Dharmkrit,

If what you require is to clear the values of fields on press of that button, then you can simply bind the values to space (' ') on press of the 'Refresh' button.

Regards,

Harsh Bansal

Former Member
0 Kudos

Hi Harsh,,

I don't want only to clear value from selection screen .

Actually I m sending value from Main view to second view . And coming back to Main view through Back button using plug.

Second time  when i m giving input for second view data is previous one. But when I m using F5 from the keyboard its working fine.

Please help me to achieve F5 functionality though action.

former_member184578
Active Contributor
0 Kudos

Hi,

Second time  when i m giving input for second view data is previous one. But when I m using F5 from the keyboard its working fine.

How you are setting the data in the second view? Are you passing the data via plugs and reading it in second view?  Or are you setting the data in WDDOINIT method of Second view?

For this scenario instead of using exit plug and reloading the entire application, use invalidate( ) method if your data is shared across the node in component controller.

If you are reading the the data from first view and based on that setting the data to second view in WDDOINIT method,

-> Just goto properties tab of second view and change the lifetime property to 'When visible' . (OR)

-> Move your DOINIT code to the HANDLE<IN_PLUG> method of second view. ( IN_PLUG is the inbound plug name of second view)

Hope this helps u,

Regards,

Kiran

Former Member
0 Kudos

Hi,

Smart Approach.

I am reading data from first view and in setting data in  WDDOINIT method of Second view .

I ahve set the proprty of view a 'When visible'

. Its working fine.

Answers (1)

Answers (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi Bhagat,

Using exit plug you can achieve your requirement as below

  • Create an out bound plug REFRESH in your window as below & activate the window

         

  • Go to the view properties tab and click on create an entry for window controller as below

    

  • Now write the below code in your event handler method

DATA lo_w_test_input_fld TYPE REF TO ig_w_test_input_fld .

lo_w_test_input_fld =   wd_this->get_w_test_input_fld_ctr( ).

  lo_w_test_input_fld->fire_refresh_plg(

    url = 'ZWDA_DEMO_TEST_INPUT_FLD'                              " string

  ).

Note:

          w_test_input_fld : is the window name ( Replace this with your window name )

          'ZWDA_DEMO_TEST_INPUT_FLD'  : is the application name( Replace this with your application name )

Hope this resolves your issue.

Regards,

Rama

Former Member
0 Kudos

Hi Rama,

Thanks for your quick and effective reply.

Does this approach reduces performance of application ?

ramakrishnappa
Active Contributor
0 Kudos

Hi Bhagat,

This approach, exits the current application and it re-loads the application again.

Hence it refreshes all the views and its context. ( considerably, you can notice the delay of loading application again )

If you just want to clear some data on the view or whole context.

You can use the method invalidate( ) of context node.

You can reset the data of whole context by using method WD_CONTEXT->invalidate( ).

Regards,

Rama