on 01-07-2013 2:18 PM
Hi
I have an image UI Element in my main view and i want to dynamically bind a MIME object (type LPEG) to it, is there a way to do that ?
Thanks
Ami
there is property in image UI element SOURCE bind it with attribute and change this attribute value dynamically.
how to know path of image :-
just simply drag the image from MIME repository onto the source parameter and it will enter the path for you.
if helpful reward points
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ami,
Add Context Attribute "SOURCE_IMG" with type String.
Add Image UI "img_id" in layout and bind its source with this context attribute.
on any method where you want to change image dynamically, put this code :
here url can be path to image on local or any url-path for web image.
call method wd_context->set_attribute
EXPORTING
name = 'SOURCE_IMG'
value = url .
I hope this is what you are looking for.
Thank you
Meet Vajaria
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ami,
Once you know the path to your mime repository objects, you can dynamically assign the image's source property by doing the following...
method onactionchangeimagesource .
data lo_view type ref to if_wd_view.
data lo_image type ref to cl_wd_image.
* Get a reference to the view, casting to the appropriate interface
lo_view ?= wd_this->wd_get_api( ).
* Get a reference to the image whose source you want to change
lo_image ?= lo_view->get_element( 'IMAGE_ID' ).
* Set the image source property
lo_image->bind_source( path = '/path/to/mime' ).
endmethod.
Check out the information in Handling Web Icons about using a relative path to a MIME object (section Supported URL Formats). An alternate approach would be to bind the image source property to a context attribute and simply change the value of the context attribute to the appropriate MIME path.
Cheers,
Amy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Amy,
I am using the URL path as below, I am notable to display the MIME Image
Please guide me in doing this.
I Tried both the options, but still not displayed
* ls_logo_url-logo = 'http://servername.domainname/sap/public/logo.bmp'.
ls_logo_url-logo = '/sap/public/logo_320.jpg'.
Kindly help in getting the exact path of the MIME Object.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.