on 06-21-2007 4:29 AM
does any one know why this statement is wrong?
try {
String url = WDURLGenerator.getAbsoluteWebResourceURL(wdComponentAPI.getComponent().getDeployableObjectPart(),"html_test.html");
} catch (WDURLException e1) {
e1.printStackTrace();
}
i got error message : unhandled exception type WDURLException ????? how come? i already catch the error type WDURLException .
Hello Oscar,
Could you check once again "html_test.html" resouce path.
Check from Navigator tab.
That should be in this path : <b>src\mimes\Components\<Component package>\html_test.html</b>
Rgds
-SS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You plan to get the current screen resolution from a HTML file. How do you pass this back to web dynpro? Are you planning to use suspend-resume plugs? I think that will make things more complicated.
You can give a try to the following:
1. Under the project's src->packages-><package name> create a new java class and call it ScreenResolution.java.
2. Add a method, <i>getScreenResolution</i> to it. The implementation is as follows:
public Dimension getScreenResolution(){
//Get the default toolkit
Toolkit toolkit = Toolkit.getDefaultToolkit();
// Get the current screen size
Dimension scrnsize = toolkit.getScreenSize();
return scrnsize;
}
Press ctrl-shift-o to organize the imports. Both Dimension and Toolkit class reside in the <i>java.awt</i> package.
3. Save the file.
4. Switch to WD and wherever you want to write the code to find the screen resolution. Write this code:
ScreenResolution res = new ScreenResolution(); //Same class as created by you
Dimension dim = res.getScreenResolution(); //java.awt.Dimension
int height = dim.height;
int width = dim.width;
wdComponentAPI.getMessageManager().reportSuccess("Height:" + height + " Width:" + width);
5. Now you can use <i>height</i> and <i>width</i> to set the size of the external window.
Caveat: I don't have the NWDS with me so I haven't checked this. So if it doesn't work...
Regards,
Satyajit.
Hi,
Switch to the <i>Navigator</i> view from the <i>Web Dynpro Explorer</i> view. You will find your project there. Expand the <i>src</i> folder. It looks like
<i>src</i>
<i>-configuration</i>
<i>-mimes</i>
<i>-packages</i>
<i>--com
---sap
-
packageName</i>
Right click on <i>packageName->New->Other...</i> From the pop-up that shows, select <i>Java</i> on the left hand side and select <i>Class</i> from the right hand side. Then say <i>Next</i> and follow the wizard.
Regards,
Satyajit.
Hi,
i have create java class, but when i copy and paste
ScreenResolution res = new ScreenResolution(); //Same class as created by you
Dimension dim = res.getScreenResolution(); //java.awt.Dimension
i got an error message "getScreenResolution" is undefined for type ScreenResolution, whats wrong with this?
Hello Oscar,
That is bcz of looking for <b>html_test.html</b> resource.But It's there so it giving WDURLException .
Can you check that resource path? , if u give proper path of the html_test.html resouce. You will come out of that error.
Rgds
SS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
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.