cancel
Showing results for 
Search instead for 
Did you mean: 

Working with the DOM using JavaScript for Web Based BPS applications

Former Member
0 Kudos

Hello,

I was trying to implement a JavaScript utility that was provided in a presentation by the Netweaver RIG.

The JavaScript error reports that the "elements" attribute/object bps-stat_roundtrip is empty. I would like to determine where within the BSP classes I can determine what attributes/objects of the DOM can be manipulated/used using JavaScript.

The script added to a TextElement is:

<SCRIPT LANGUAGE="JavaScript" type="text/javascript">
function ShowResponseTime()  {
  var bspForm = document['bspform'];
  alert ("Response time of last server roundtrip: " +
  bspForm.elements["bps-stat_roundtrip"].value +
  " ms");
 }
 </SCRIPT>

 <input class="sapBtnStd"
   type = "button"
   value = "Response Time"
   onClick = "ShowResponseTime()">

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member93896
Active Contributor
0 Kudos

Hello Alan,

unfortunately the script does not work with the new design of the web interface, which is based on HTMLB. The form elements are not populated anymore (I will check with development why a change was made).

Also the form ID was changed. The form is not called "bspform" anymore. You can use the following to access the form:

var bspform = getForm();

In general you can play with the complete DOM. However, it is up to you to guarantee the consistency of the data that is being sent back to the server (i.e. the form content).

Regards,

Marc

SAP NetWeaver RIG