Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9990

Re: SAPUI5 with JSON or XML Data.

$
0
0

I am using the Below code ......y its not working Error is comming ........if the cross browser is the issue for this code ,,,,,then tell me how to disable the cross domain issue in browser Friend

<html>

<head>

  <meta http-equiv="X-UA-Compatible" content="IE=edge" />

  <title>SAPUI5 Conditional Databinding</title>

  <script src="resources/sap-ui-core.js"

    type="text/javascript"

    id="sap-ui-bootstrap"

    data-sap-ui-libs="sap.ui.commons,sap.ui.table"

    data-sap-ui-theme="sap_goldreflection">

  </script>

 

 

  <script>

    jQuery.sap.log.setLevel(jQuery.sap.log.LogLevel['ERROR']);

 

 

 

 

        // create the DataTable control

 

 

        var oTable = new sap.ui.table.Table({editable:true});

 

 

       

 

 

        // define the Table columns

 

 

        var oControl = new sap.ui.commons.TextView({text:"{RESULT/POSTING}"}); // short binding notation

 

 

        oTable.addColumn(new sap.ui.table.Column({label: new sap.ui.commons.Label({text: "Posting"}), template: oControl }));

 

 

        

 

 

        var oControl = new sap.ui.commons.TextView({text:"{RESULT/TITLE}"}); // short binding notation

 

 

        oTable.addColumn(new sap.ui.table.Column({label: new sap.ui.commons.Label({text: "Title"}), template: oControl }));

 

 

 

        var oModel = new sap.ui.model.json.JSONModel();

   

        var aData = 

        jQuery.ajax({

 

 

           url: "http://www.pipetree.com/qmacro/scratchpad/vincent.json",  // for different servers cross-domain restrictions need to be handled

 

 

           dataType: "json",

 

 

           success: function(data, textStatus, jqXHR) { // callback called when data is received

            oModel.setData(data);             // fill the received data into the JSONModel

  alert("sparta");

           },

 

 

           error: function(jqXHR, textStatus, errorThrown) {

          alert("error");

           }

 

 

        });

 

 

        oTable.setModel(oModel);

 

 

        oTable.bindRows("/RESULTS");

 

 

       

 

 

        // finally place the Table into the UI

 

 

        oTable.placeAt("dataTable");

 

 

 

 

  </script>

 

 

</head>

 

 

<body class="sapUiBody">

  <h1>SAPUI5 Conditional Databinding</h1>

  <div id="dataTable"></div>

</body>

</html>


Viewing all articles
Browse latest Browse all 9990

Latest Images

Trending Articles



Latest Images