cancel
Showing results for 
Search instead for 
Did you mean: 

How to clear context before navigation?

Former Member
0 Kudos

Hi,

I have a Web Dynpro ABAP application running in the portal which display some data in a textedit depending on a couple of parameters. These parameters are captured using a selection screen in a BI iView and sent using a portal event.

Here's the problem : when the user navigates to another page and then back to the page containing the WD ABAP iView, the textedit element already contains some data (corresponding to the previous selection). It should be empty because the BI iView is initialized and no selection has been made.

Is there a way to invalidate the context when the user navigates to another page in the portal? I tried to use the WDDOEXIT method but it doesn't work.

Regards,

Pierre

Accepted Solutions (1)

Accepted Solutions (1)

abhimanyu_lagishetti7
Active Contributor
0 Kudos

on back there must be some inbound plug handler, write a code to invalidate the context node inside the handler

use INVALIDATE method of the IF_WD_CONTEXT_NODE.

Former Member
0 Kudos

Hi,

I know I have to use the invalidate method but I don't know when (i.e in which method) I must call it.

Regards,

Pierre

abhimanyu_lagishetti7
Active Contributor
0 Kudos

generally when you navigate to one page the application is instantiated again and a new instance is run.

in this case, you can set the Lifetime of the view to when visible, so everytime you are back you see the selection screen cleared.

Former Member
0 Kudos

in the same Action that the user is clicking to navigate to the new screen after navigation you can call your context node and invalidate the values. e.g. lo_nd_context->invalidate( ).

Thanks!

Jason PV

Former Member
0 Kudos

Hi,

It seems it is not always the case because when the user navigates back to the page, the previous data is still in the textedit. How to make sure the instance is destroyed and a new one is created?

Regards,

Pierre

Former Member
0 Kudos

Hi,

There's no action involved : the user can just navigate to another page by clicking on a link in the menu. I could invalidate the context when this happens if I knew how to trigger an action when the user navigates to another page in the portal.

Regards,

Pierre

Former Member
0 Kudos

if the link is in the portal and not inside the WD component object then the WD don't know what is happening because the link is an IVIEW outside your WD code and is opening a regular IVIEW (like a new tab) but the WD is not reading any action so you don't have control of what happens outside the WD component, for the WD is actually a user IDLE in the object.

Jason PV

Former Member
0 Kudos

If you add the IVIEW as a link inside your webdynpro and create an action link (instead of having the link outside the webdynpro) then your problem is solve.

you will have control between the WD an the external IVIEW, it will be required to call the IVIEW form the WD.

I just did that with a standard SAP iview that I have in my portal and it works fine.

thanks!

Jason PV

Former Member
0 Kudos

Hi,

I don't understand, which iView do you want to add as a link?

I can't prevent the user from navigating to another random page (UWL, personalization, another role...) in the portal.

Regards,

Pierre

Former Member
0 Kudos

Hi,

You have to disable to Client Caching property for the WebDynpro Iview.

That will make sure that when the browser back button or a portal link is used to come back to the application. A new instance of the webDynpro application is launched.

Please make sure you are not using any suspend and resume plugs in the Web dynpro component.

Thanks,

Kalyan

Answers (0)