on 04-11-2006 6:04 AM
hi everyone,
i had successfuly done the example WebDynpro_InterAppNav
and it is working fine with urlparameters passed by me.. and it is displaying in the target application.....
but, when i try to print the passed url parameters in the init() method of target application view....it is not displaying...the data...
can anybody help me out in this....
regards
-
sunil
Hi Sunil,
What is the code that you are using to display the parameters?
Also, share the structure of your URL.
Regards,
Satyajit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hai satyajit,
i had created a project with two applications...
1)StartApp
2)TargetApp
i am moving to targetapp when i am existing the startapp.
this i am doing, if i click on a button in startapp using fire plug to exit that i had created in exitplug of startapp by passing url string as argument to that exit plug....and i am mapping the url parameters
this following code i am doing in startview.. when click on Go... it will go to targetapp.
public void onActionGo(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionGo(ServerEvent)
// Get component's message manager
IWDMessageManager messageMgr = wdComponentAPI.getMessageManager();
// Get name of deployable object this component belongs to
String deployableObjectName =
wdComponentAPI.getDeployableObjectPart().getDeployableObjectName();
Map urlParameters = new HashMap();
// get URL parameter value entered by user, stored in context attribute
// UrlParamValue. Put parameter hugo in the sneak preview version.
urlParameters.put(
"hugo",
wdContext.currentContextElement().getUrlParamValue());
try {
// Get deployable object part of target application.
// Precondition: assume, that other application belongs to the same
// Web Dynpro Project (Deployable Object)
WDDeployableObjectPart deployableObjectPart =
WDDeployableObject.getDeployableObjectPart(
deployableObjectName,
"TargetApp",
WDDeployableObjectPartType.APPLICATION);
// Get target URL based on deployable object part and URL parameters
String urlToTargetApp =
WDURLGenerator.getApplicationURL(
deployableObjectPart,
urlParameters);
// Fire exit plug to target URL via IPublic-API of used interface view
// controller
wdThis
.wdGetStartAppInterfaceViewController()
.wdFirePlugStartAppExit(
urlToTargetApp);
} catch (WDURLException e) {
messageMgr.reportException(e.getLocalizedMessage(), false);
} catch (WDDeploymentException ex) {
messageMgr.reportException(ex.getLocalizedMessage(), false);
}
//@@end
}
Now, in targetapp component controller, i had created a context attribute..
when the targetapp received the parameters from startapp i.e in default inbound plug of target app....
i am moving that data to context attribute i had created in the component controller....
everything working fine....
the thing is when i displaying the data in the init method it is not displaying...
the same thing.....i displayed the data in domodify method like this...
if(firsttime)
{
//here it is displaying....
}
but i want do display in the init.. how to do that...
i need it to work in init....
Hi Sunil,
From your code I am guessing that the parameter name is "hugo" and your URL to targetApp will be something like
http://<server>:<port>/webdynpro/dispatcher/sap.com/local/targetApp?hugo=1234
If that's the case, then try the following piece of code:
String urlParams = WDWebContextAdapter.getWebContextAdapter().getRequestParameter("hugo");
You will need this import:
<i>import com.sap.tc.webdynpro.services.sal.adapter.api.WDWebContextAdapter;</i>
Also, why do you need to do it specifically in the init method? If in your doModifyView(), you have a condition like <i>if(firstTime)</i>, it should serve your purpose.
Unless, ofcourse, you need to use these values again in the init method itself.
Regards,
Satyajit.
Hi Sunil,
This is not a problem with the application. When an application is triggered, the wdDoInit() method of the component controller & the view runs first, even before the default inbound plug method of the interface view runs. Therefore the value being set from the plug method won't be accessible in the wdDoInit() method.
To read the url parameter you may use the method suggested by Satyajit.
Hope this helps,
Best Regards,
Nibu.
Hai Sunil,
Try to use the code in wdModifyView() method in the Condidtion..
wdModifyView(){
if(firstTime){
//place your code here..
}
}
regards,
Naga Raju
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.