cancel
Showing results for 
Search instead for 
Did you mean: 

Adding Image Dynamically

Former Member
0 Kudos

Hi Experts,

How to add images using dynamic programming which are in the MIME folder in my Webdynpro Component.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hi vikranth,

when creating an image object u will have exporting property

imagesource directly give the name of the mime object like 'xyz.jpg'.

Regards,

janakiram.

Former Member
0 Kudos

Hi Janakiram Raju,

I need to create images dynamically from the Mime in my webdynpro component.

Former Member
0 Kudos

hi vikranth,

use follwing code

data: lo_image type ref to cl_wd_image,

lo_container type ref to cl_wd_uielement_container.

lo_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).

lo_image = cl_wd_image=>new_image( image_source = 'ICON_CREATE' ).

cl_wd_flow_data=>new_flow_data( element = lo_image ).

lo_container->add_child( lo_image ).

regards,

janakiram.

Edited by: janakiram raju on Mar 4, 2008 1:30 PM

Former Member
0 Kudos

Hi Vikranth,

Try like this.

For Dynamic Image creation you have to pass the Image sources [Image names like 1.bmp] to the attribute of the Context node.

Using SET_ATTRIBUTE you can pass the Image sources to Attributes.

wd_context->set_attribute( name = 'IMAGENAME' value = item_image_input ).

From the above code "item_image_input" contains the Image name.

Then Using New_image method from class CL_WD_IMAGE you can add the new image.

CALL METHOD wd_context->get_attribute
  EXPORTING
    name   = 'IMAGENAME'
  IMPORTING
    value  = TEMP.
    .
IMAGE = cl_wd_image=>new_image(  SOURCE = TEMP ).

    CALL METHOD cl_wd_grid_layout=>new_grid_layout
      EXPORTING
        container = root_container.

    CALL METHOD cl_wd_grid_data=>new_grid_data
      EXPORTING
        element = IMAGE.

    root_container->add_child( IMAGE ).

Thanks.