on 02-08-2017 4:42 PM
Hi all,
im learning to use value help dialog and trying with a simple example but im unable to bind to table element in the valuehelp dialog. i believe its a minor mistake with binding as the ui5 plugin in chrome shows the binding context in sap.ui.table.Row. The table opens blank
here is the code
var names = [ {firstname:"Radhesh", lastname: "Shinde",location:"Mumbai"}, {firstname:"Vighnesh", lastname: "Kamath",location:"Pune"}, {firstname:"Archit", lastname: "Wahi",location:"Nagpur"} ];
abc: function(){
var inp = new sap.ui.comp.valuehelpdialog.ValueHelpDialog({ title: "Company", });
var model = new sap.ui.model.json.JSONModel(names);
var table = inp.getTable(); table.setModel(model);
console.log(model);
var col1 = new sap.ui.table.Column({ label:"firstname" });
table.addColumn(col1);
var col2 = new sap.ui.table.Column({ label:"secondname" });
table.addColumn(col2);
var col3 = new sap.ui.table.Column({ label:"location" });
table.addColumn(col3);
//table.bindAggregation("rows","/");
table.bindRows("/");
console.log(table.hasModel());
inp.open();
}
Please provide input.
Many thanks
Archit Wahi
There is no template available for the column to load the data, use below code for the columns
var col1 = new sap.ui.table.Column({
label:"firstname",
template: new sap.m.Text({text: "{firstname}" }) //bind template to fisrtname
});
table.addColumn(col1);
var col2 = new sap.ui.table.Column({ label:"Second name", template: new sap.m.Text({text: "{secondname}" }) //bind template to secondname in model });
table.addColumn(col2);
var col3 = new sap.ui.table.Column({ label:"location", template: new sap.m.Text({text: "{location}" }) //bind template to location in model });
table.addColumn(col3);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.