on 09-06-2011 3:21 PM
Hello everybody,
I have a WD component with an ALV table bound to a context node. Works very fine so far.
Now in the first column of the node I have put an image source (MIME object in my WD component).
I configured the first ALV column as Link To Action and now would like to link it to the image source. My problem is that the image is not loaded in the ALV.
This is my coding (INIT method of my view):
METHOD wddoinit .
DATA: lo_alv_cmp TYPE REF TO if_wd_component_usage,
lo_alv_if TYPE REF TO iwci_salv_wd_table,
lo_alv_config TYPE REF TO cl_salv_wd_config_table,
lo_column_settings TYPE REF TO if_salv_wd_column_settings,
lo_column TYPE REF TO cl_salv_wd_column,
lo_link_to_action TYPE REF TO cl_salv_wd_uie_link_to_action.
get instance of ALV component
lo_alv_cmp = wd_this->wd_cpuse_alv( ).
IF lo_alv_cmp->has_active_component( ) IS INITIAL.
lo_alv_cmp->create_component( ).
ENDIF.
get instance of ALV Interface Controller
lo_alv_if = wd_this->wd_cpifc_alv( ).
configure ALV
lo_alv_config = lo_alv_if->get_model( ).
lo_column_settings ?= lo_alv_config.
lo_column = lo_column_settings->get_column( 'IMAGE' ).
CREATE OBJECT lo_link_to_action.
fix settings for test purpose (how must I change it to get the information from the context node??)
lo_link_to_action->set_image_height( '50px' ).
lo_link_to_action->set_image_width( '50px' ).
lo_link_to_action->set_image_source( 'ICE Flottenportal.jpg' ).
lo_column->set_cell_editor( lo_link_to_action ).
ENDMETHOD.
Thanx a lot in advance for any help!!
Sorry for not explaining clearly enough. I will try again:
The context node which is bound to the ALV has a field "image_source" in which the image source is saved as string value.
What I want do do now is to bind this value to the IMAGE_SOURCE attribute of my LINK TO ACTION column.
Is there any method etc. for doing this?
Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oh, I see... quite obvious, but I misunderstood the method at first.
Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a lot for your helpful advice.
I now found that method cl_wdr_utilities=>get_mime_path is the best way to get the path.
But one question is still open:
How can I retrieve my image source from the context? Do I have to read the context and then write it to the image_source attribute? Or ist there a more elegant solution?
Thank you for any help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As suggested, you need to give the complete path of the image from the MIME repositroy.
like as follows.
'/SAP/BC/WebDynpro/SAP/<ur comp>/<imagename>'
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.
You need to refer the full path of the image location.
You can try something like this and replace <component_name> with you component name
lo_link_to_action->set_image_source( 'Isap/bc/webdynpro/sap/<component_name>/CE Flottenportal.jpg' ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
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.