cancel
Showing results for 
Search instead for 
Did you mean: 

Change image sap.ui.ux3.Feeder

Former Member
0 Kudos
56

Hi,

Is it possible to change the image of the sap.ui.ux3.Feeder control (the button)?

I want to make the button inside the feeder dynamic, it would be nice if I could change the image and/or add text inside the button.

I've already tried to change the image with jQuery, but I'm not sure if I am doing it right:

$("#Feeder-send-image").attr("src","img/servicedesk.png");

Thanks,

RW

Accepted Solutions (1)

Accepted Solutions (1)

jmoors
Active Contributor
0 Kudos

Looks like you can configure the image URLs in the library-parameters.json file, alternatively I guess you could override the initSendButton method.

   "sap.ui.ux3.Feed:sapUiFeedToolsIconUrl": "/img/feed/Action_Menu_regular.png",

    "sap.ui.ux3.Feed:sapUiFeedToolsIconHoverUrl": "/img/feed/Action_Menu_hover.png",

    "sap.ui.ux3.Feeder:sapUiFeederArrowLargeUrl": "/img/feed/Feeder_arrow_large.png",

    "sap.ui.ux3.Feeder:sapUiFeederArrowMediumUrl": "/img/feed/Feeder_arrow_medium.png",

    "sap.ui.ux3.Feeder:sapUiFeederArrowSmallUrl": "/img/feed/Feeder_arrow_small.png"

Regards,

Jason


sap.ui.ux3.Feeder.prototype.initSendButton = function(){

  if (this.getText() == "") {

  // no re-rendering as button is not rendered now.

  this.oSendButton.setProperty('enabled', false, true);

  }

  var sArrow = "";

  switch (this.getType()){

  case( sap.ui.ux3.FeederType.Medium):

  sArrow = sap.ui.core.theming.Parameters.get('sap.ui.ux3.Feeder:sapUiFeederArrowMediumUrl');

  break;

  case( sap.ui.ux3.FeederType.Comment):

  sArrow = sap.ui.core.theming.Parameters.get('sap.ui.ux3.Feeder:sapUiFeederArrowSmallUrl');

  break;

  default: // large feeder is default

  sArrow = sap.ui.core.theming.Parameters.get('sap.ui.ux3.Feeder:sapUiFeederArrowLargeUrl');

  break;

  }

  if (!sArrow || sArrow == "") {

  // no arrow image

  // no re-rendering as button is not rendered now.

  this.oSendButton.setProperty('text', '-->', true);

  } else {

  // no re-rendering as button is not rendered now.

  if (sap.ui.getCore().getConfiguration().getRTL()) {

  sArrow = sArrow.replace(/\/img\//, "/img-RTL/");

  }

  this.oSendButton.setProperty('icon', jQuery.sap.getModulePath("sap.ui.ux3", '/') + "themes/" + sap.ui.getCore().getConfiguration().getTheme() + sArrow, true);

  }

};

Former Member
0 Kudos

Hi Jason,

Thanks for your reply! I can change the icon now!

I'm also able to change the icon with text by adding this line:

this.oSendButton.setProperty('text', "test");

Kind regards,

RW

Answers (0)