on 07-06-2010 8:24 AM
Hi
I have an WD4A app and I would like to import sap's standard icons such as s_b_okay.gif to be displayed in my app
based on some condition. My question is how do I call these icons and attach them to image UI elements I have
created?
Thanks for yr help
Yuval Peery
HI Perry ,
You can bind the image sourse property of your UI with the attribute type string and programatically you can change the value for the image source based on your condition
Sample code :
DATA lo_el_context TYPE REF TO if_wd_context_element.
DATA ls_context TYPE wd_this->Element_context.
DATA lv_image TYPE wd_this->Element_context-image.
* get element via lead selection
lo_el_context = wd_context->get_element( ).
if condition = 1. " here you can change icon based on your condition
lv_image = '~Icon/Add'. " or you can get the value from table - ICON & copy the text , Eg : @00@ lv_image = ' @00@'.
else.
lv_image = '~Icon/AddRow'.
endif.
* set single attribute
lo_el_context->set_attribute(
name = `IMAGE`
value = lv_image ).
Regards
Chinnaiya P
Edited by: chinnaiya pandiyan on Jul 6, 2010 4:14 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Peery
There are 2 ways in using Images
1) If the image is a custom image, then import the image as a MIME object(RIght click on the WDAP project->Create->Mime Object->Import) and use the image name as the imageSource property for the UI Element
2) If the image is a standard SAP, then directly mention the image/icon name under the imageSource property of the UI element.
Note: all the icons are listed in ICON table (SE11)
Thanks and Regards
Chaitanya.A
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.