on 07-01-2011 12:43 PM
Hi gurus,
I am stuck with some issu, here is my issue as fallows
Scenario:
I am planning to open outlook client by passing some java script and i want to attach history of the email like same as reply button in MSoutlook
- To call java script i am using webwidget UI element in WDJ and on action of button i am calling that java script like as fallows
String html = ReplyAll_class_j.callActiveXFromHTML(this.wdComponentAPI,"toemail", "fromAdd", "Subject of email", <html><body>htmlbody</body></html>);
wdContext.currentContextElement().setHtml(html);
- in java class i am passing some java script like as fallows
public static String callActiveXFromHTML(IWDComponent compAPI,String toMailAddress,String ccEmailAddress,String mailSubject,String htmlBody) {
Script is here
}
the Issue is when i click the button it is not opening the outlook client but it is doing when i am click on the tab to recall the component, I thought it is doing this because i am passing "this.wdComponentAPI" as a parameter, but i dont know other solutions so please help me in this issue
thanks in advance
Anu
Hi,
I am not sure why is that statement "WE CANNOT CALL JS from WDJ"???? I did that pretty number of time in my developments. Can you please try the below mentioned way...
Inside your method what ever you write to open the JS window
String htmlcontent="Your HTML Content";
try
{
byte[] html=new byte [ 4096 ] ;
html=htmlcontent.getBytes("UTF-8");
wdContext.currentContextElement().setVaHTML(html);
IWDWindow win =wdThis.wdGetAPI().getComponent().getWindowManager()
.createNonModalExternalWindow(WDWebResource.getWebResource(html, WDWebResourceType.HTML).getURL(),"window Name As per your choice");
win.setWindowSize(600,600);
win.removeWindowFeature(WDWindowFeature.ADDRESS_BAR);
win.removeWindowFeature(WDWindowFeature.TOOL_BAR);
win.removeWindowFeature(WDWindowFeature.MENU_BAR);
win.show();
}
catch(WDURLException url)
{
wdComponentAPI.getMessageManager().reportException("WDURLException::"+url.toString(),true);
}
Regards,
SrinivaS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Srinivas,
Thank you for your reply it was really helpful answer it solved our problem, but i want to hide that window after running my java script, and also i found one more thing that this java script is alive because when i reload the page this outlook client is opening again, so is there any otherway to kill this after the event handling, please help me in this one srinivas, it will solve our problem and we can fix the isuue
Thanks
anu
In your html, after your JavaScript has executed, simply use window.close() to close the popup.
However, if you don't want a popup at all, a better approach would be to use a small WDIFrame component in your view, and have the HTML written to the iframe as needed.
Since a refresh of the view would also refresh the iframe and thus re-run the JavaScript, be sure to replace the embedded html with an empty html.
Robin
In general we cann't call the JavaScript from Web Dynpro.
I would suggest u to develop the app in JSPDynpages, so that you can have the flexibility of calling javascripst etc.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
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.