on 03-15-2018 7:34 AM
Hi All,
I have applied a model filter in my UI5 code for display 'EQ' value in table based on user input and it is working. But i want to provide a custom message when that value doesn't exists in OData Model. Below is my code...please advice.
var aFilter = [];
var sQuery = mResult.text;
if (sQuery !== "") {
aFilter.push(new Filter("ProductID", FilterOperator.EQ, sQuery)); // I need to display a custom message when input value doesn't match with 'ProductID' in Odata.
var oTable2 = that.getView().byId("tableId");
var oBinding = oTable2.getBinding("items");
oBinding.filter(aFilter); that.getValues();
}else
{
sap.m.MessageToast.show("Please Enter correct value");
}
Thanks
Dheerendra
Just a fly-by suggestion: If the value doesn't exist in the OData model, I'm interpreting from that, that there are no matches based on the product ID entered. It might be an idea to have a message showing what you need to show, but initially not visible. Bind the visibility to a formatter that has access to the items you're fetching, and set the value according to how many there are (ie set visible to true if there are no items).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
11 | |
8 | |
8 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.