Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3523

Uncaught TypeError: sap.m.TableSelectDialog is not a function

$
0
0

Hello Experts,

 

I am trying to use TableSelectDialog in my application. On click of button, I am trying to open the dialog and this is when I receieve this error.

I have included the necessary sap.m library file too. Below is the code for reference.

 

 

 

  var dataObject = [

    {Product: "Power Projector 4713", Weight: "1467"},

    {Product: "Gladiator MX", Weight: "321"},

    {Product: "Hurricane GX", Weight: "588"},

    {Product: "Webcam", Weight: "700"},

    {Product: "Monitor Locking Cable", Weight: "40"},

    {Product: "Laptop Case", Weight: "1289"},

    {Product: "Power Projector 4713", Weight: "1467"},

    {Product: "Gladiator MX", Weight: "321"},

    {Product: "Hurricane GX", Weight: "588"},

    {Product: "Webcam", Weight: "700"},

    {Product: "Monitor Locking Cable", Weight: "40"},

    {Product: "Laptop Case", Weight: "1289"},

    {Product: "Power Projector 4713", Weight: "1467"},

    {Product: "Gladiator MX", Weight: "321"},

    {Product: "Hurricane GX", Weight: "588"},

    {Product: "Webcam", Weight: "700"},

    {Product: "Monitor Locking Cable", Weight: "40"},

    {Product: "Laptop Case", Weight: "1289"},

    {Product: "Power Projector 4713", Weight: "1467"},

    {Product: "Gladiator MX", Weight: "321"},

    {Product: "Hurricane GX", Weight: "588"},

    {Product: "Webcam", Weight: "700"},

    {Product: "Monitor Locking Cable", Weight: "40"},

    {Product: "Laptop Case", Weight: "1289"},

    {Product: "Power Projector 4713", Weight: "1467"},

    {Product: "Gladiator MX", Weight: "321"},

    {Product: "Hurricane GX", Weight: "588"},

    {Product: "Webcam", Weight: "700"},

    {Product: "Monitor Locking Cable", Weight: "40"},

    {Product: "Laptop Case", Weight: "1289"}];

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

    model.setData({

    modelData: {

    productsData : []

    }

    });

    sap.ui.getCore().setModel(model);

    sap.ui.getCore().getModel().setProperty("/modelData/productsData", dataObject);

 

 

  

    var oDialog = new sap.m.TableSelectDialog({

    title :"Product List",

    id:"ProductTable",

    growingThreshold : 5,

         columns: [

          new sap.m.Column({

    header: new sap.m.Label({text: "Product"}),

    }),

       new sap.m.Column({

                    header: new sap.m.Label({text: "Weight"}),

           })

         ],

         items: {

           path: "/modelData/productsData",

           template: new sap.m.ColumnListItem({

             cells: [

    new sap.m.Text({

                 text: "{Product}"

               }),

     new sap.m.Text({

                 text: "{Weight}"

               })

             ]

           })

         }

       });

  

    oDialog.open();

 

 

 

Thanks & Regards,

Archana


Viewing all articles
Browse latest Browse all 3523

Trending Articles



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