cancel
Showing results for 
Search instead for 
Did you mean: 

sap.ui.comp.valuehelpdialog.ValueHelpDialog - duplicate data is appearing in output

Former Member
0 Kudos

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){ sap.m.MessageToast.show("Cancle pressed!"); this.close(); }, selectionChange: function(oControlEvent){ sap.m.MessageToast.show("Selection changed!"); }, updateSelection:function(oControlEvent){ sap.m.MessageToast.show("Selection changed!"); }, tokenRemove: function(oControlEvent){ sap.m.MessageToast.show("Selection changed!"); }, beforeOpen: function(oControlEvent){ sap.m.MessageToast.show("Selection changed!"); }, afterOpen:function(oControlEvent){ sap.m.MessageToast.show("Selection changed!"); }, beforeClose:function(oControlEvent){ sap.m.MessageToast.show("Selection changed!"); } });

2)I created a Model

var oModel2 = new sap.ui.model.odata.ODataModel( "https://pgdmain.wdf.sap.corp/sap/opu/odata/sap/ZACCCLERK_SRV/");

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

var oTable = oHelpDialog.getTable();

oTable.setModel(oModel2);

4)

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);

6)

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

});

oHelpDialog.setFilterBar(oFilterBar); oHelpDialog.open();

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

Thanks

Durga Prasanth

Accepted Solutions (0)

Answers (0)