cancel
Showing results for 
Search instead for 
Did you mean: 

Refresh event in sap.m.searchfield

Former Member
1,200

Hi Everyone,

I am trying to perform some action on clicking refresh (X button) in sap.m.searchfield. whenever I am clicking on refresh button I am unable to catch the refresh event.

Please someone help me to how to catch the refresh event.

is there any method to catch the event.

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

karthikarjun
Active Contributor
0 Kudos

I agree with sai. Addition to that, can you please refer this method.

_pushNewProduct: function () {
var aColl = this._productData.ProductCollection;
if (this._productCount < aColl.length) {
var oView = this.getView();
var oData = oView.getModel().getData();
oData
.ProductCollection.push(aColl[this._productCount++]);
oView
.getModel().setData(oData);
}},


And refer this link too: SAPUI5 Explored


Regards,

Karthik A

Former Member
0 Kudos

Thanks for your reply Karthik

saivellanki
Active Contributor
0 Kudos

Hi Siddappa,

If you set property showRefreshButton to true, it will just replace the search icon with refresh icon. You have to handle the logic of refresh button in search event only.

Check this sample: Plunker


Code:


        onRefresh: function(oEvent) {

          var oRefreshButton = oEvent.getParameter("refreshButtonPressed");

          if (oRefreshButton) {

            var list = this.getView().byId("idList");

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

            binding.filter(null);

          }

        }

Snippet:


Regards,

Sai Vellanki.

Former Member
0 Kudos

Thank You so much sai