Furthermore you can use component interfaces to abstract any component embedder from the concrete implementation of the embedded component. Doing this it is for example very easily possible to add a new, customer-specific component implementation at runtime to a running Web Dynpro application.
All in all you should think “in components” when implementing Web Dynpro applications.
Nevertheless you will probably create different Web Dynpro applications in the end and doing that it is sometimes necessary to provide some possibilities to navigate from one Web Dynpro application to another.
In general there are three different possibilities doing this depending on the environment, in which the Web Dynpro application is executed.
1) Run it as one single application
The easiest way to navigate between Web Dynpro applications is to put the two applications into one application by merging the related Web Dynpro components together under one common root component. In this scenario the navigation is a simple Web Dynpro navigation between the different interface views of the related components handled by the root component.
This scenario is of course not always possible, but it is worth to think about it. A lot of problems related to the navigation between different applications are not existing in this scenario because you can only one application. It is for example very easy and straightforward to define any kind of “state”, which should be forwarded from one application to another by defining the needed context for example in the component controller of the root component.
2) Running standalone applications
This scenario is well-described in the inter-application navigation article available here at SDN.
Therefore only some short remarks:
- You have to define an exit plug for the interface view of the root component of your application.
- You have to add a string parameter called url to the exit plug.
- To compute the needed Web Dynpro application URL you have to use one of the WDURLGenerator.getApplicationURL(…) methods.
- You have to trigger a navigation to the exit plug passing the computed Web Dynpro application URL.
3) Running the applications inside the SAP Enterprise Portal 6.0
When running inside the portal the only suggested way to navigation between different Web Dynpro applications is the (absolute or relative) portal page navigation or the object-based navigation. Only the usage of these technologies make sure, that the navigation is visible for the portal and all needed information is passed to the navigation target.
The approach offers the following advantages:
- The navigation step is visible in the portal page history if needed.
- To navigate back you can use the generic portal page back navigation functionality.
- Both the starting application and the target application is executed in the exactly same environment (i.e. as an iView). If you would navigate to another Web Dynpro application using the mechanism described in chapter 2 (i.e. using the pure Web Dynpro application URL), you break this and the target application runs in an “mixed” and totally undefined environment. One consequence could be that the used portal theme is not longer valid.
Therefore we strongly recommend to use ONLY page navigation or object-based navigation when running inside the portal.
To trigger a portal navigation within a Web Dynpro application you should use the WDPortalNavigation service. To trigger an absolute page navigation you should use one of the navigateAbsolute methods. The relative page navigation is triggered by one of the navigateRelative methods. The object-based navigation is triggered using one of the navigateToObject .
There are several articles available here in SDN describing the portal navigation in detail.