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