on 11-04-2014 11:25 AM
Hi Eshwar,
As suggested, use the class CL_SALV_WD_FE_TOGGLE_BUTTON to create toggle button and use methods
For setting image: SET_IMAGE_SOURCE ( )
for setting text : SET_TEXT( )
checked image : checkedImageSource
Check the below wiki, which guides through the toggle button in alv toolbar
SAP List Viewer - ALV - Web Dynpro ABAP - SCN Wiki
Hope this helps you.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
When I use the below code I am getting dump.
data: lr_buttonui TYPE REF TO cl_salv_wd_fe_toggle_button,
button TYPE REF TO cl_salv_wd_function.
CREATE OBJECT lr_buttonui
EXPORTING
CHECKED_ELEMENTNAME = 'CHECKED'.
lr_buttonui->set_text( 'Select All Attacments' ).
lr_buttonui->set_image_source( 'ICON_OKAY' ).
lr_buttonui->set_checked_image_source( 'ICON_OKAY' ).
lr_buttonui->set_tooltip( 'Select All Attachments' ).
button = lv_value->if_salv_wd_function_settings~create_function( id = 'ALLA' ).
button->set_editor( lr_buttonui ).
BR,
Eshwar
Hi,
Thanks, that one is solved.
Now how to toggle.,
I have a custom button on ALV toolbar with text and an image, when I click on the button text should change and image should change.
I have created a event handler method using the event ON_FUNCTION.
Now in this method, say
case .
when 'TOGGLE'
-----
-----what should be implemented or should I follow any other approach
------
endcase.
Thanks & BR,
Eshwar
Hi Eshwar,
Create an attribute in View of type toggle button GO_TOGGLE_BUTTON, when you create button first time save the reference
wd_this->go_toggle_button = lr_buttonui
Now, on action,
set the text and image source by using method set_image_source( ) and set_text based on condition.
case .
when 'TOGGLE'
wd_this->go_toggle_button->set_image_source( "ICON_DUMMY" ).
wd_this->go_toggle_button->set_text( "Deselect All" ).
when others.
wd_this->go_toggle_button->set_image_source( "ICON_CHECKED" ).
wd_this->go_toggle_button->set_text( "Select All" ).
endcase.
Hope this helps you.
Regards,
Rama
Hi,
check this document Add custom functions in ALV Toolbar Instead of button you can use CL_SALV_WD_FE_TOGGLE_BUTTON for Toggle button.
hope this helps,
Regards,
Kiran
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 | |
24 | |
11 | |
9 | |
7 | |
5 | |
5 | |
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.