cancel
Showing results for 
Search instead for 
Did you mean: 

WD navigation - Exiting application back to calling screen.

Former Member
0 Kudos

Hi Gurus,

Simple WD question. I'm developing an "exit" button that would enable the program to navigate back to the calling screen which is either an Iview or a UWL message.

I tried finding snippet, tuts and reference codes but couldn't any.

Is there any API or methods that enable me to retrieve the calling URL of the application? Or do I need a few more steps to generate/retrieve those URLs?

Any gurus kind enough to help? Thanks alot!

Regards,

Jansen

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Jansen,

You can Navigate to an IView using this coding

WDPortalNavigation.navigateAbsolute("ROLES:"+iviewPath,WDPortalNavigationMode.SHOW_INPLACE,(String) null,

(String) null, WDPortalNavigationHistoryMode.NO_DUPLICATIONS,(String) null,(String) null,"PATAM_NAME=PARAM_VALUE");

the "ROLES"+iviewPath is the url of the IView

the ,"PATAM_NAME=PARAM_VALUE" is some of parameter and it's values

Kind Regards

Mukesh

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi all,

Thanks all for the suggestions. As off now I'm use Bala Krishnan's suggestion of WDPortalEventing.fire method.

It is working as expected if I run the application from a static iview. However the problem comes if I'm t o run the application via UWL.

Somehow "urn:com.sapportals:navigation", "historyNavigate", "-1" does work in UWL. I was thinking maybe the namespace is different.

And I cannot use Mr Nagarajan's suggestion of using WDPortalNavigation.subscribe was I don't think I can change the UWL views.

Mr Bala, could you enlighten me on how you derive the content of the namespace "urn:....." ? I can't seem to find any reference to it. Pls Help...

Thanks all for their advises.

Regards,

Jansen

Former Member
0 Kudos

Hello Jansen,

Very strange. I've not tried it yet from UWL page. The URN is correct as per my knowledge.

You may try <a href="http://help.sap.com/saphelp_erp2005/helpdata/en/c3/235a428a1e9041e10000000a1550b0/frameset.htm">Absolute Page Navigation</a> and <a href="http://help.sap.com/saphelp_erp2005/helpdata/en/c3/235a428a1e9041e10000000a1550b0/frameset.htm">Relative Page Navigation</a> as the alternative solutions.

Good Luck,

Bala

Former Member
0 Kudos

Thanks guys for the quick replies,

Actually I'm aware of WDPortalNavigation.navigateAbsolute() and wdFirePlugAppExit() methods.

My main problem is still the on retrieving of the URL of my previous screen. Any tips?

WDURLGenerator.getStaticApplicationURL() doesn't work and WDURLGenerator.getApplicationURL seemed to give me a dump.

Markus, can you elaborate on the usage of the deployable object? Thanks. I welcome all advise and will reward!!

Regards,

Jansen

Former Member
0 Kudos

Jansen,

Why not to give a try to simplest solution: calling application pass own URL to called one, then called application uses this URL to navigate back.

VS

Former Member
0 Kudos

Jansen Low,

Use this code:

WDPortalEventing.fire("urn:com.sapportals:navigation", "historyNavigate", "-1");

This will help you emulate the behaviour that you want.

The aforementioned line of code will take you to the previous page in the history list of the portal. In short, to the UWL, from where you launched your WD application.

Good Luck,

Bala

Former Member
0 Kudos

Hi Jansen,

If u use <b>WDPortalNavigation.fire("urn:sap.com","Exit","");</b> in the iview where u want to navigate to different iview then u have to subcribe an event in the resulting iview.

The iview which u want to see after the 1st closes. In the init method of this iview

<b>WDPortalNavigation.subscribe("urn:sap.com","Exit",wdThis.WDGet<Action name>);</b>

In the action u can perform ur resulting operation.

This is mostly preferred for refresing components inside the portal page.

Hope it helps,

Regards,

Nagarajan.

Former Member
0 Kudos

Hi,

The key is using the deployable part.

Have a look at WDUrlGenerator, it has methods to get to the URL of a deployable part, feed your applications deployable part into it.

I don't know the exact methods right away but it is something along the lines of

wdComponentApi.getApplication().getDeployablePart().

If you want to log out the user you can feed the URL

directly to WDClient.forceLogoff() (don't remember the exact name here either - but you get the idea).

I think you can also use the PortalNavigation service with deployable parts.

Hope this helps

Markus

Former Member
0 Kudos

Janson,

Try using Exit plugs to accompolish your requirement.

1. In the Web Dynpro explorer expand the node <WD project> – Web Dynpro Components – <YourComponent> – Component Interface – Interface Views – <YourComponent>InterfaceView and then double-click on it.

2. Select the tab "Plugs".

3. Add a new outbound plug of type "Exit plug" (Mark checkbox "Exit Plug" in the window that pops up for the New Outbound Plug) and name it as "AppExit" and choose Next.

4. By clicking "New", add a new parameter with name <b>Url</b> (Use exactly the same name Url) of type

<b>String</b> and choose Finish.

Now add the interface view controller usage to the required view from which you have to exit and go back to a URL.

1. Select the Web Dynpro Components – <YourComponent> – Views – <YourView>.

2. Select the Properties tab.

3. Add the required usage of the controller <YourComponent>InterfaceView.

Then, create a button in your view (say "Back") and associate it to the event / action handler.(say, onActionExit).

In the event handler write the code like this:


public void onActionExit(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent)
{
    // controller
    wdThis.wdGet<YourComponent>InterfaceViewController()
.wdFirePlugAppExit(<<i>TargerURL</i>>);

}

Please note that upon exiting, all the involved components will be destroyed automatically by the WD runtime.

All the aforementioned points are available in the standard tutorial

<a href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/inter-application-navigation%20in%20web%20dynpro.pdf">Inter-Application-Navigation</a>

You may refer the same for any further assistance.

Bala