Skip to Content
0

Binding List in same page based on button click

Jan 16 at 10:20 AM

28

avatar image
Former Member

Hello All,

I have a SAP UI5 View with 2 input fields, a button and a list.

My requirement is to fill up the list on button click with input from two input fields.

Data is coming from O Data Service and getting filtered based on the input field values.

Code snippet is:

var oView = this.getView();

var lv_pernr = oView.byId("IpPernr").getValue();

var lv_nachn = oView.byId("IpNachn").getValue();

var lv_vorna = oView.byId("IpVorna").getValue();

var oModel = new sap.ui.model.odata.v2.ODataModel("/sap/opu/odata/sap/name_of_service/"); this.getView().setModel(oModel);

var filters = new sap.ui.model.Filter({

and: true,

filters: [new sap.ui.model.Filter("Pernr", sap.ui.model.FilterOperator.EQ, lv_pernr),

new sap.ui.model.Filter("Nachn1", sap.ui.model.FilterOperator.EQ, lv_nachn),

new sap.ui.model.Filter("Vorna1", sap.ui.model.FilterOperator.EQ, lv_vorna)

]

});

var binding = this.byId("list").getBinding("items");

binding.filter(filters);

Is there anything wrong with my code as lv_pernr, lv_nachn, lv_vorna is not getting populated on button click even though I am giving input.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Irfan Gokak Jan 16 at 01:43 PM
0

Hi,

Did not understood your issue.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jan 17 at 10:12 AM
0

Hi Irfan,

Issue is resolved.

Thanks

Share
10 |10000 characters needed characters left characters exceeded