cancel
Showing results for 
Search instead for 
Did you mean: 

Html access in webdynpro java

smruti_moharana
Participant
0 Kudos

Dear Experts ,

Please guide me to populate  context data in a html table.

Thanks &Regards,

Smruti Ranjan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Dear Smruti,

Are you using Web Widget UI?

Then you have to append the code into String Buffer & set that inside html properties of Web Widget UI.


int l_datasize = wdContext.nodeOutput_Itab().size();//Output node of RFC execution

  StringBuffer buffer = new StringBuffer();

//Html Head,title

  buffer.append("<!DOCTYPE html><html><head><title>XXX</title>");

buffer.append("<style type='text/css'>");

//Html body

  buffer.append("body {");

  buffer.append("background-color: #DBE8F9;");

  buffer.append("font: 11px/24px 'Lucida Grande', 'Trebuchet MS', Arial, Helvetica, sans-serif;");

  buffer.append("color: #5A698B;");

  buffer.append("}");

//Html table-table header

buffer.append("<br>Table:<table class='gradienttable'><tr><th><p>SrNo</p></th><th><p>Field</p></th><th><p>Mandt</p></th>");

  buffer.append("<th><p>HdNo</p></th><th><p>LnNo</p></th><th><p>Error</p></th></tr>");

  for (int i = 0; i < l_datasize; i++) {

  l_data=wdContext.nodeOutput_Itab().getOutput_ItabElementAt(i);

//Html table-table data

  buffer.append(" <tr><td><p>"+l_data.getSr_No()+"</p></td><td><p>"+l_data.getField()+"</p></td><td><p>"+l_data.getMandt()+"</p></td>");

  buffer.append(" <td><p>"+l_data.getMig_Hd_No()+"</p></td><td><p>"+l_data.getMig_Lin_No()+"</p></td><td><p>"+l_data.getError()+"</p></td></tr>");

  }

  buffer.append( "</table></div>");

.....

Thanks,

Patralekha

smruti_moharana
Participant
0 Kudos

Hi Patralekha,

Thanks a lot for your valuable suggestion ,Is there any way to directly access  context element in side webdynpro java application.i am using the below code to draw org chart  ui in html.

wdComponentAPI.getMessageManager();



"";


for(int i=1;i<10;i++)



try



"<html>"+


"<title>My First HTML Page from WD</title>"+


"</head>"+


"<body>"+ "<p>This is a HTML Page generated from WebDynpro for Java</p>"+""+


// "<tr>"+"<td>"+"</td>"+"</tr>"+"</body>"+"</html>";


"<div style='width:50px;height:50px;border:5px solid #FFCC00;'/>"+"</body>"+"</html>";



"UTF-8"),"FirstPage.html",WDWebResourceType.HTML);


wdContext.createAndAddTreeNodeElement().setLinkToHtml(objectResource.getUrl(WDFileDownloadBehaviour.OPEN_INPLACE.ordinal())); 


//wdContext.createAndAddTreeNodeElement().setLinkToHtml(wdContext.nodeResult_Object().getResult_ObjectElementAt(i).getStext());



catch (Exception e)



// TODO: handle exception


Thanks & regards,

Smruti Ranjan Moharana

Answers (1)

Answers (1)

junwu
Active Contributor
0 Kudos

detail your scenario

smruti_moharana
Participant
0 Kudos

Dear Jun,

In my current application i need to draw a org chart (i need to draw some dynamic squre boxes according to size of the context node).

Thanks &Regards,

Smruti Ranjan Moharana