Skip to Content
Former Member
Nov 02, 2016 at 09:16 AM

valuehelpdialog.ValueHelpDialog - duplicate data is appearing by using ODATA


Hi All,

I had used the below code for the ValueHelp to get the data from the backend system but the issue is i am getting same data multiple times.

For example i have 10 records and with different data in the Backend system but when in displaying same record 10 times.

1) I had declared the valuehelpdialog

var oHelpDialog = new sap.ui.comp.valuehelpdialog.ValueHelpDialog( { title: "Company Code", supportRanges : false, supportMultiselect: false, key:"BUSAB", descriptionKey:"BUSAB", filterMode: true, ok: function(oControlEvent){ var aTokens = oControlEvent.getParameter("tokens"); //oInput.setTokens(aTokens); var oContext = oTable.getContextByIndex(oTable.getSelectedIndex()); if(oContext) { var oSel = oContext.getModel().getProperty(oContext.getPath()); oInput.setValue(oSel["BUSAB"]); } this.close(); }, cancel: function(oControlEvent){"Cancle pressed!"); this.close(); }, selectionChange: function(oControlEvent){"Selection changed!"); }, updateSelection:function(oControlEvent){"Selection changed!"); }, tokenRemove: function(oControlEvent){"Selection changed!"); }, beforeOpen: function(oControlEvent){"Selection changed!"); }, afterOpen:function(oControlEvent){"Selection changed!"); }, beforeClose:function(oControlEvent){"Selection changed!"); } });

2)I created a Model

var oModel2 = new sap.ui.model.odata.ODataModel( "");

3)I had used the Get table and set the table to Model

var oTable = oHelpDialog.getTable();



oTable.addColumn(new sap.ui.table.Column({ label: new sap.ui.commons.Label({text: "Accounting Clerk"}), visible: true, template: new sap.ui.commons.TextField({value: "{BUSAB}"}) }));

5)I had used the Filter option and Bind the Rows with the Table

var FilterOperator = sap.ui.model.FilterOperator; var filter = new sap.ui.model.Filter("BUKRS", FilterOperator.EQ, comCodeval2); oTable.bindRows("/AccClerkSet", null, null, filter);


oHelpDialog.setRangeKeyFields([{label:"Accounting Clerk", key:"BUSAB"}]); var oFilterBar = new sap.ui.comp.filterbar.FilterBar("SearchId1", { advanceMode: true, filterBarExpanded: false, searchEnabled: true, showGoOnFB: false,



I am geeting same record multiple times and could you please let me know any change i need to do in the code.


Durga Prasanth