on 02-08-2011 10:31 AM
Hi
I am building web dynpro for the first time.
I try to display image in IMAGE UI but can't see image.
What is wrong with this source ?
Please help.
-
-
get image from mime repository
data:mime_repository type ref to if_mr_api,
content type xstring,
url type string value 'SAP/BC/WebDynpro/SAP/Z_HT_MIME/image.jpg'.
mime_repository = cl_mime_repository_api=>get_api( ).
call method mime_repository->get EXPORTING i_url = url
IMPORTING e_content = content.
set context
data:lo_element TYPE REF TO if_wd_context_element,
ls_context type REF TO wd_this->element_context.
lo_element = wd_context->get_element( ).
lo_element->set_attribute( name = 'URL' value = content ).
-
-
※If source is set image directly, Image is displayed.
Type of Context 'URL' is String.
Thanks
Tom
In the source property of hte image uI just give
'image.jpg'
it will coem automatically.
thanks
sarbjeet singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry about my blind explanation.
I would like to build ALV containing image column which was displayed dynamically.
I ask above because I will think that images is used as shared data by not only this webdynpro but other webdynpros Aftertime,
In the first place if I have false design , tell me that.
Tom
Thanks Baskaran.
My doubt was cleared !
But following code make image not displayed.
data:url type string value 'SAP/BC/WebDynpro/SAP/Z_HT_MIME/image.jpg'
lo_element = wd_context->get_element( ).+
lo_element->set_attribute( name = 'URL' value = url ).
Setting url 'image.jpg' , Image is displayed.
What is wrong ? Is my declaration of path wrong ?
For displaying image using image UI, it is enough to supply the URL for the source.
You do not need to get the content of type xstring. This procedure is used for getting the PDF or office files.
It is not applicable for image UI source property.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.