Skip to Content
author's profile photo Former Member
Former Member

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

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Dec 14, 2016 at 02:16 PM

    Did you find a solution for your problem?

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.