Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

HTTP form post from Web Dynpro Java Application without opening new window

Hi Experts,

We are trying to submit form data to an external URL from Web Dynpro Java application. We are achieving this with the following piece of code.

  try

  {

   strPrintContent="<html>"+

     "<head>"+

     "<script type=\"text/javascript\">"+   

     "function myfunc () "+

     "{"+

     "var frm = document.getElementById(\"paymentForm\");"+

     "frm.submit();"+

     "}"+

     "</script>"+

     "</head>"+

     "<body onLoad=myfunc()>"+

     "<form id=paymentForm  method=post action=\""+merchantURLPart+"\">"+

     "<INPUT type=hidden name=username value="+userName+">"+

     "<INPUT type=hidden name=pass value="+passWord+">"+

     "<INPUT type=hidden name=senderid value="+senderID+">"+    

     "<INPUT type=hidden name=dest_mobileno value="+mobile+">"+

     "<INPUT type=hidden name=message value='"+msg+"'>"+

     "<INPUT type=hidden name=response value="+response+">"+

     "</form>"+

     "</body>"+

     "</html>";    

  

  IWDWebResource webResource = WDWebResource.getWebResource(strPrintContent.getBytes(),WDWebResourceType.HTML);

  IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(webResource.getAbsoluteURL(),"WBSEDCL");

  window.show();

         

  }

  catch(Exception e)

  {

 

 

  wdComponentAPI.getMessageManager().reportException("Error : "+e.toString(),false);

  }

But it opens another window. We dont need that. We have to stay on the same window.  Please suggest what can be done.

Former Member
Former Member replied
Not what you were looking for? View more on this topic or Ask a question