on 2014 Feb 19 3:08 PM
Hi Experts,
I have created a selectDialog for mobile apps. I am facing the problem when I am trying to search value from the list in dialog. Below is my code:
| _handleValueHelpSearch:function(oEvent) |
{
| var sValue = oEvent.getParameter("value"); | |
| var oFilter = new sap.ui.model.Filter("Vendor", | |
| sap.ui.model.FilterOperator.Contains, sValue); | |
| // | oEvent.getSource().getBinding("items").filter([ oFilter ]); |
| var dialog = oEvent.getSource().getId(); | |
| dialog.getBinding("items"); |
},
The Variable dialog showing the accurate id for my dialog screen but showing exception for bold line. The exception is:
Uncaught TypeError: Object myDialog has no method 'getBinding'
Whereas this method is available for selectdialog. Due to this I cant search the element. It is showing no value.
I need help for this. Kindly provide the solutions.
Thanks & regards,
Arindam Samanta.
Request clarification before answering.
Example Posted Here
https://gist.github.com/anonymous/9132228
JSON Data is the following
//The basic Test Data
var listData = {
Plants: [ {
plant: "Plant ABC",
id: "9001",
}, {
plant: "Plant DEF",
id: "9002",
}]
};
And the Search and LiveChange work by filtering on the plant element
var selectFilter = new sap.ui.model.Filter("plant", sap.ui.model.FilterOperator.Contains , sVal);
One of the key differences with both the Select Dialog and Table Select Dialog, are they have no render engine in them as they are Helper Controls, AKA a combination of standard SAPUI5 Controls packaged into another Control.
This means to get the data here is a bit different as the bound elements get passed down to the child control. So you need to get them this way.
var itemsBinding = oEvent.getParameter("itemsBinding");
Hope this helps
Martin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
id is string, getBinding is defined on objkect, try
oEvent.getSource().getBinding("items");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Actually I have written the below code for searching:
var sValue = oEvent.getParameter("value");
var oFilter = new sap.ui.model.Filter("Vendor",
sap.ui.model.FilterOperator.Contains, sValue);
oEvent.getSource().getBinding("items").filter([ oFilter ]);
I have searching value in oFilter but at the end it is showing no data whereas the data is available in list. So I tried to break the code like previous post.
My code is right and bold part of the code is also right. Why then the my search is unsuccessful??
Kindly give the input.
Thanks & Regards,
Arindam Samanta.
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 6 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.