on 07-11-2008 7:00 PM
Hi Experts,
How can we Create an External Window means i have two components and i want to show one view of first component as an external window(Not Model Window) in second component after passing some input from second component to first componet,so my problem is What will be the url and how the input parameters will be passed from second compont to show the view.
Thanks And Regards
Trilochan
Hi,
What will be the url and how the input parameters will be passed from second compont to show the view.
You need to create an application that points to your view. You can use the url of the application
Append parameters at th end of the URL and access them from the DC using WDProtocolAdapter class getRequest.get method.
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Ayyapparaj KV ,
can u please describe it how we can pass parameters means i have to pass some input from second componet by which it excute some query and show the first component view which is in external window i m able to open this window but not able to understand how we pass the required input as paramter with url.
Thanks and Regards
Trilochan
Hi,
If you want to pass parameters using url then just append it in the url that we got above strUrl;
eg strUrl+="?parameter1=value1¶meter2=value2";
In the newly opened window, just read these parameters in the wdDoInit() method:
String value1 = (String)wdProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("parameter1"):
String value2 = (String)wdProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("parameter2"):
Regards,
Murtuza
hi,
i have written this pice of code in a button action by which i want to show external window.
try{
String inputValue=wdContext.currentContextElement().getInput();
String strURL = WDURLGenerator.getApplicationURL("sap.com/", "Win1");
strURL+="?parameter1=inputValue";
IWDWindow window = wdComponentAPI.getWindowManag().createNonModalExternalWindow(strURL,"My Second Window");
window.setWindowPosition(100,100);
window.setWindowSize(650,600);
window.show();
}catch(Exception e){
wdComponentAPI.getMessageManager().reportException("Exception in onActionShow()"+e.getLocalizedMessage(),false);
}
and in wdDoInit() method of requried view which is shown in external window of second component (application) i have written this pice of code
String value1 = (String)WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("parameter1");
String value2 = (String)WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("parameter2");
but i m not able to access these values here.
i m getting this exception
Exception in onActionShow()Failed to generate URL to deployable object 'sap.com/', application 'Win1'.
how i can resolve this.
Regards
Trilochan
Hi,
It means that the path and the window name that you are specifying is incorrect:
String strURL = WDURLGenerator.getApplicationURL("sap.com/", "Win1");
String strURL = WDURLGenerator.getApplicationURL("sap.com", "Win1");
Also, to pass value you need to change
strURL+="?parameter1=inputValue"; to
strURL="?parameter1="inputValue;
Try this and let me know whether it worked or not.
Regards,
Murtuza
Hi,
Refer to this link:
http://help.sap.com/saphelp_nw04s/helpdata/en/b6/a45b42bcbfd242e10000000a1550b0/frameset.htm
Regards,
Apurva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
For data transfer between the 2 windows you can use cache.
Here is the code for data transfer as well as opening up an external window.
Assuming below is the name of your dc
/TRACK_NAMEaabbccxx.company.com
Change the parameters in the code according to the name of your DC
try{
ICacheService putcache = (ICacheService) PortalRuntime.getRuntimeResources().getService(ICacheService.KEY);
putcache.put("Node", wdContext.nodeNode1(), true);
String strURL = WDURLGenerator.getApplicationURL("xx.company.com/aabbcc", "<application name>");
IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(strURL,"Title");
window.setWindowPosition(100,100);
window.setWindowSize(650,600);
window.show();
}catch(Exception e){
e.printStackTrace();
}
Now, in the wdDoInit() method of the view that is to be opened in the external window, you need to read the cache and set the parameters:
ICacheService putcache = (ICacheService) PortalRuntime.getRuntimeResources().getService(ICacheService.KEY);
IWDNode Node1 = (IWDNode)putcache.get("Node");
WDCopyService.copyElements(Node1,wdContext.nodeNode1());
Regards,
Murtuza
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
You can show one view of one component as an external window in another component by creating two applications one for each component.
Then in the first component's view controller write the code in the event handler of any action(button click etc.) to create an external window.
and here give the url of the second application.
the URL of the second application can be found by
using the function -
>
*String url = WDURLGenerator.getApplicationURL(deployableObjectPart, urlParameters);*
where deployableObjectPart is found for the second aaplication by the method
String deployableObjectName =
wdComponentAPI.getDeployableObjectPart().getDeployableObjectName();
WDDeployableObjectPart deployableObjectPart =
* WDDeployableObject.getDeployableObjectPart( deployableObjectName,"TargetApp",WDDeployableObjectPartType.APPLICATION);*
where TargetApp is the name of the second application.
Urlparameter is used to pass the parameters to the second component's view
use the following code to map the parameters.
Map urlParameters = new HashMap();
urlParameters.put("Pname","Pvalue");
here Pname is the key for the parameter passed and Pvalue is the value of the parameter.
give the same name(Pname) to the parameter for start plug of the second application.
thats it now
write the code to create the external window and give "url" as its url.
To access the parameter in the second window use the interface view of the target component.
there you will find one eventhandler with name onPlug<start plug name>.
In this method you can access that particular parameter and store it in some context attribute in the controller's context and then in the target view you can access this context attribute of the controller.
that's it.
hope it will sort out your problem.
Regards,
Sarbjeet Singh
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
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.