cancel
Showing results for 
Search instead for 
Did you mean: 

Refresh web dynpro

Former Member
0 Kudos

Hello,

I'm new to abap web dynpro and my scenario is that I have two web dynpro applications. The first application calls the second application. The second application that is called is actually a popup in the first application. What the applications are doing is the first application is a list of tasks and when a user wants to change a task they click on a task in the first application and it calls the second application in a popup where the user can change this task. When they are done changing the task the second application closes and shows the first application again. The problem is that when a user updates a task and goes back to the first application I need the first application to refresh to reflect this updated data. Is there a way that I can refresh the first application?

Thanks,

Abra

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

As i think there is no any method to refresh the scren. What u can done is write the code in Domodify of the first view.

But i am not getting why ur code is not running. Without refresh also it should show the updated data only. U can write the code in Coponent controller and then call this method from the Ok button of the Pop Up view. It will work fine.

Please clarify where u are writing the code, if still have the problem.

Regards,

Pankaj Aggarwal

Answers (5)

Answers (5)

Former Member
0 Kudos

Yeah the mapping between the context is working fine. But I thought you said that I needed to call a method from the event that closes the second application window that will refresh the context of the first application. Is this correct? If so I am not sure how to refresh the context of the first application.

Thank you!

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

No, I said if you don't have a cross component mapping, you could call a method to update the data. Perhaps in this method you re-read the database and pickup any updates that were made by the inner component usage and then refresh your local context. However if you have cross component context mapping, you shouldn't need to do anything. The mapped context will be kept in sync by the framework.

Former Member
0 Kudos

hi Abra ,

as soon as u are finish with the functionality of your dialog window , u need to call another method in ur component.

this method would actually pick up the updated entries from the data base .

I was just going through this article

Link: [WD ABAP Context Tool|http://www.sdn.sap.com/irj/scn/index;jsessionid=(J2EE3417600)ID0171210750DB10836658104771494406End?rid=/library/uuid/0d4c303f-0d01-0010-79bc-8b0ae9be5030&overridelayout=true]

on sdn and thought it better to share it with u . It can help u .

rgds,

amit

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>

> hi Abra ,

> I was just going through this article

> Link: [WD ABAP Context Tool|http://www.sdn.sap.com/irj/scn/index;jsessionid=(J2EE3417600)ID0171210750DB10836658104771494406End?rid=/library/uuid/0d4c303f-0d01-0010-79bc-8b0ae9be5030&overridelayout=true]

>

> on sdn and thought it better to share it with u . It can help u .

>

> rgds,

> amit

You know you don't need this custom tool to debug the context now. As of SP9, SAP added a special Web Dynpro tool to the ABAP debugger. You can just use the the debugger to view the context at runtime. No need to import a special component usage as in this example.

Former Member
0 Kudos

In my case I do have one node that uses cross component mapping but unfortunately that is not the node that has the data in it that needs to be refreshed. Therefore, I think I need to write a method to do this. My thinking was that I should write a method in the controller of the first application that would update the context with the new data and call that method from the second application event ok button. In order to do this I would have to also declare a component usage of my first application in my second application. I tried this and I am getting an error that says Component Usage DASHBOARD Does Not Have an Active Component. I do not understand this error.

Am I going about this the correct way or what am I doing wrong?

Thank you!

Former Member
0 Kudos

Does anyone have any further help on this? Any help is greatly appreciated!

Thank you!

Former Member
0 Kudos

Hi,

Please make the node in your used component whose view is acting like a popup as "Interface Node".

In the view context of your calling component, do a "Controller Usage", and drap drop the Interface Node of called component in you calling view context node.

Regards,

Prosenjit.

Former Member
0 Kudos

Problem solved. I just added code in the modifyview of the first application to select the updated data from the database and it works!

Thanks!

Former Member
0 Kudos

There is only one node in the context that is mapped between the two applications but if this node got refreshed it would not cause a problem. The problem is that I don't know how to refresh the context of the main application. I dont know what code does this.

Thank you!

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You shouldn't need to do anything to sync the context. If it really is mapped between the two components, any update to the context in one component will be reflected in the other componet. The framework takes care of the sync.

Former Member
0 Kudos

I believe this is a popup because it is launching as a dialog window over the main window. The second window is not launched in a new browser window. I have declared the second application in my first application under the properties tab under used controllers/components. Then I call the second application window with the following code:

  • Go to the maintenance view

data lo_window_manager type ref to if_wd_window_manager.

data lo_api_component type ref to if_wd_component.

data lo_window type ref to if_wd_window.

lo_api_component = wd_comp_controller->wd_get_api( ).

lo_window_manager = lo_api_component->get_window_manager( ).

lo_window = lo_window_manager->create_window_for_cmp_usage(

interface_view_name = 'FROM_DASHBOARD'

component_usage_name = 'MAINTASK'

  • title =

  • close_in_any_case = abap_true

message_display_mode = if_wd_window=>co_msg_display_mode_selected

).

lo_window->open( ).

When the user is done updating the task in the second application and they want to go back to the first application I just close the second application window using the following code:

data: l_api type ref to if_wd_view_controller,

l_window_ctlr type ref to if_wd_window_controller,

l_popup type ref to if_wd_window.

l_api = wd_this->wd_get_api( ).

l_window_ctlr = l_api->get_embedding_window_ctlr( ).

if l_window_ctlr is bound.

l_popup = l_window_ctlr->get_window( ).

l_popup->close( ).

endif.

But when the second application window closes the first application doesn't reflect the changes that were just made. Is there a way to refresh the first application so that after a user makes a change they can see it right away without having to refresh the browser themselves.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Since this is a dialog window, then you do have code that is firing when the window closes. Why not just call a method from this event to refresh your context of the main application. I assume that since you are calling an external component usage that you don't have a shared/mapped context.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Is this really a popup where you are launching as a dialog window over the top of the main window - or are you using navigation plugs to launch a separate application in a new browser window? In the second approach you have two completely separate user sessions on the server. There is no communication between these two sessions once launched.

Former Member
0 Kudos

I think the reason why it is not already showing the updated data is because the popup is actually a whole other web dynpro application that is being called.

I am unsure of what code needs to go into the domodifyview method. Also even if I write this code in the component controller of the first application I don't think I can call it from the second application popup ok button.

Thanks!

Former Member
0 Kudos

Hi,

If u are calling a second component application as a pop up that means u are using the component usage. And then also u can have

the event handler of the ok button in the main component, and if the event handler is in ur main component the as i think there is no

problem in updating the data.