on 2014 Aug 05 6:48 AM
Hi,
I am developing a master-detail SAPUI5 application that contains sap.m.table in details page with sap.m.button "Accept" for each row.
The requirement is this button should be enabled based on another property from ODATA response.
In the below code, i am creating a template with 3 columns as label & 4th column as button. This button should be enabled based on a property " Acceptance" that is returned from ODATA response. If the row is accepted, i should disable the button & if not, enable the button.
The problem is i will not have "Acceptance" property value till i do the binding. Looking into another forum, i found that there is a bindProperty() that gets called for each row & an object can be controlled through that. But, here also i am not able to get the Property value "Acceptance".
can anyone pls suggest how i can fetch the value of Acceptance & control this button enable/disable? I also tried calling a controller function from bindProperty, that also dint help.
pose_table.bindAggregation("items", {
path : "/ServiceEntrySheet",
template: new sap.m.ColumnListItem({
cells: [
new sap.m.Label({ text: "{SheetNo}" }),
new sap.m.Label({ text: "{GrossVal}" }),
new sap.m.Label({ text: "{Currency}" }),
new sap.m.Button("se_accept_btn",{
text : "Accept",
press : oController.approve,
visible : true,
//enabled : true,
}).bindProperty("enabled", "/ServiceEntrySheet",function(){
var sheetNumber = "{SheetNo}";
alert(sheetNumber);
/*alert("accept button="+cellValue);
if("{Acceptance}"=="X"){
//alert("accepted ="+cellValue);
this.setEnabled("false");
this.setText("Accepted");
}else{
//alert("not accepted ="+cellValue);
enabled: true;
}*/
}),
]
})
});
Dharini.,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
10 | |
10 | |
10 | |
10 | |
8 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.