0

I need to attach an image source for a button in my sap web dynpro. But I have to do that at runtime. So that I can dynamically chose an image from the mime repository and attach it to the button.

Is there a way to do that? I really have no ideas anymore...

Thanks for your help!

Regards,

Dominic

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Dyrdek
  • 411
  • 4
  • 12
  • 33
  • What have you tried so far - i. e. have you tried to bind the property to an appropriate variable? – vwegert Apr 11 '16 at 07:10
  • I tried to bind it to an context element, that didn't work out. Actually it's pretty easy if you know the method you need to call. It's describe in this [link](http://www.sapyard.com/lets-web-dynpro-part-vi/) very well. The guy there creates a button at runtime and adds an image source via method call `CALL METHOD lr_button->set_image_source [...]`. – Dyrdek Apr 11 '16 at 09:02

1 Answers1

5

In the set of properties of your button, you have the property 'imageSource' that contains the source of your image. You can bind this property to a variable in the context (say 'buttonIcon') . If you then change the content of this variable, the binding will update the button's icon.

PATRY Guillaume
  • 4,287
  • 1
  • 32
  • 41