Quantcast
Channel: SCN : Discussion List - SAP HANA and In-Memory Computing
Viewing all articles
Browse latest Browse all 5653

Html - XSJS issue

$
0
0

Hi,

 

I have a xsjs script which delete's a record based on the input parameter. If i execute this via a URL, its deleting the record properly.

But when i call from Html page which has a Text field and a submit button, its not deleting the record even though its calling the xsjs.

 

------------------------------ XSJS Content --------------------------

$.response.contentType = "text/html";

 

var body='';

var app_id=$.request.parameters.get('app_id');

 

var query = "delete from Table where application_id='"+app_id+"'";

var conn = $.db.getConnection();

var pstmt = conn.prepareStatement(query);

var updateCount = pstmt.executeUpdate();

body = updateCount.toString();

conn.commit();

$.response.setBody("Number of records updated:"+body);

 

$.response.status=$.net.http.OK;

 

------------------------------ End  --------------------------

 

-------------------------- HTML ----------------------

 

var oButton4 = new sap.ui.commons.Button({

                           text : "Submit",

                           style: sap.ui.commons.ButtonStyle.Emph,

                           press : function(oEvent,oInput1) {

                                       var jURL = '../demo/demo/updateLOG.xsjs';

                                       jQuery.ajax({

                                           url:jURL,

                                           method: 'POST',

                                           dataType:'json',

                                           success: myFunction.onComplete,

                                           error: myFunction.onErrorCall                                                        

                                       });

                              

                                   }

              

              

              

               }).placeAt("content");

 

 

---------------------- END --------------------------

 

Thanks for the help

 

NAresh


Viewing all articles
Browse latest Browse all 5653

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>