on 03-12-2009 8:37 AM
Hi All,
I need to display an HTML page, which provides some information to user, when user clicks on a link or button. I have made the required HTML page. But I dont know how to open that page from the web dynpro application and where to keep that page.
Please provide me some useful guideline.
Regards,
Bhargav
Hi Bhargav,
Use IFrame UI element and set its source property to HTML page.
Regards,
Siva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi.
import some API in you view--codding
import com.sap.tc.webdynpro.services.sal.url.api.WDWebResource;
import com.sap.tc.webdynpro.services.sal.url.api.WDWebResourceType;
import com.sap.tc.webdynpro.services.session.api.IWDWindow;
import com.sap.tc.webdynpro.services.session.api.WDWindowFeature;
Create one method as displayPrint() and create one action for click on button as ShowHTML action for show button
and create one Context value attribute as Htmlcontent set as TYpe-Binary
goto attribute click on itlook at TYPE property of attribute as change string to Binary
Create Two extra method in View...
In VIEW--
public java.lang.String displayPrint( )
{
//@@begin displayPrint()
StringBuffer htmlcontent=new StringBuffer();
htmlcontent.append("<html><body>");
htmlcontent.append("<input type=\"text\" name=\"su\" >");
htmlcontent.append("<input type=\"text\" name=\"se\" >");
htmlcontent.append("<input type=\"submit\" name=\"sre\" value=\" show\" >");
htmlcontent.append("</html></body>");
return htmlcontent.toString();
//@@end
}
In View--
public void onActionShowHTML(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
byte[] content = new byte[4028];
try {
content = this.displayPrint().getBytes("UTF-8");
wdContext.currentContextElement().setHtmlcontent(content);
// Where content is loaded with data from displayPrint() method, which is holding the HTML *page to be displayed to the user *
IWDWindow win =wdComponentAPI
.getWindowManager()
.createNonModalExternalWindow(WDWebResource
.getWebResource(content, WDWebResourceType.HTML)
.getURL(),"ShowVideo");
win.setWindowSize(445,460);
win.removeWindowFeature(WDWindowFeature.ADDRESS_BAR);
win.removeWindowFeature(WDWindowFeature.TOOL_BAR);
win.removeWindowFeature(WDWindowFeature.MENU_BAR);
win.open();
} catch (Exception e) {
wdComponentAPI.getMessageManager().reportException ("Unable to open window"+e,false);
}
}
thanks
jati
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Create a Non Modal window and give the link.
IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow("http://google.com");
window.show();
Jithin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bhargav,
The best way is to use the IFrame UI element. You can do one thing as you have said " I have made the required HTML page.", so you can just store that HTML page in the local server location or even in the project struture, and set the IFrame Ui element's source property to this HTML page.
Doing this will show you HTML page in this IFRAME.
I hope this helps
Thanks and Reagrds
Pravesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
If u want to navigate to external HTML like google ,gmail etc So user linkToURL UI Element and provide the URL , Try same for custom URL which is with you.
Best Regards
Satish Kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bhargav,
You can try giving the local path in the non modal window parameter. Please note that this webdynpro application will not pick the page from your local directory if you are using this kind of approach (i.e.: Non modal Window). It will always pick the page from the server directory. If you place the html file in the server directory and then give its reference, You will be able to view that HTML page.
Also try to use this:
"<Your_Machine_Name>\\D:\\Name_of_YourFile";
.... may be this works!!
I hope this helps.
Thanks and Regards,
Pravesh
Edited by: Pravesh Verma on Mar 12, 2009 5:10 AM
User | Count |
---|---|
79 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.