Skip to Content
author's profile photo Former Member
Former Member

How to place an image on a button! (HTMLB)

I got it:

<htmlb:button id = "myButton14"

text =

"<img src='/sap/public/bsp/sap/public/bc/icons/s_s_okay.gif' border='0'>OK "

onClick = "myButtonClick"

encode = "FALSE" />

The size of the button changes. To prevent this just set the image height to 10.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Dec 01, 2004 at 10:52 AM

    You can also do it this way if you want your image to come from the HTMLB library:

      data image type ref to cl_htmlb_image.
      data: image_string type string.
      create object image.
      image->id = `UserSelectionCancel2`.
      image->src = cl_bsp_mimes=>sap_icon( `ICON_CHECKED` ).
      image->tooltip = ``.
      clear image_string.
      image_string = image->IF_BSP_BEE~RENDER_TO_STRING( page_context ).
      <htmlb:button id  = "UserSelectionCancel"
                encode  = "FALSE"
                  text  = "<%= image_string %> &nbsp <OTR>Text to go with the Image</OTR>" />

    Message was edited by: Thomas Jung

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.