cancel
Showing results for 
Search instead for 
Did you mean: 

sap.m.select event

former_member225463
Participant
0 Kudos

Dear Experts,

I have a requirement in which i am using sap.m.select control and the items should get bind to it , should happen when i click the arrow button

which comes in sap.m.select.

In other way on clicking of the drop down , an oData has to be fired and the item aggregation has to happen on success of the odata call.

I checked there is only one event change , which usually fires when we change the item selection.

Please help me on this to achieve this functionality.

Regards,

Vikash

Accepted Solutions (1)

Accepted Solutions (1)

former_member225463
Participant
0 Kudos

Hello All,

I have solved the requirement by extending the sap.m.Select Control

Created one file select.js and wrote the following code:

sap.ui.define([

  "sap/m/Select"

], function(select) {

  //jQuery.sap.declare("vikash.select");

  var customSelect = select.extend("vikash.select", {

  metadata: {

  events: {

  "click": {}

  }

  },

  onclick: function() {

  this.fireClick();

  },

  renderer: {},

  onAfterRendering: function() {

  if (sap.m.Select.prototype.onAfterRendering) {

  sap.m.Select.prototype.onAfterRendering.apply(this, arguments);

  }

  }

  });

  return customSelect;

});

in controller i called the path

sap.ui.define([

"vikash/select"

and in view as

xmlns:customselect="vikash"

<customselect:select selectedKey="{FailureCode}">

<core:Item key="{FailureCode}" text="{FailureText}"/>

</customselect:select>

Hope this helps others

Regards,

Vikash

Answers (0)