on 10-13-2015 12:01 PM
Hi I am trying to create a one dynamic icon in list uibb ( without configuring anything from the List Configuration). Is it possible to create a dynamic icon.
I tried with the below options:
1) Created action and assigned to ET_ACTION_DEFINITION for fpm event action.
2) Called a method ADD_BUTTON_ROW and got the button row ref.
3) Called a method ADD_BUTTON_ROW_ELEMENT(Button Type: BT) and passed the above button row ref. in the GET_DEFAULT_CONFIG method.
But button/icon is not getting created.
Is this is correct or should we go ahead with any way to create a icon in list toolbar.
Hello Amarnadh,
In ADD_BUTTON_ROW_ELEMENT method, we have a parameter called IS_SPECIAL_PROPERTIES. This structure contains the 'IMAGE_SOURCE' as one of the property.
Fill this structure with this property and pass SPECIAL PROPERTIES parameter while calling ADD_BUTTON_ROW_ELEMENT method.
Sample Code:
data: ls_special_properties type FPMGB_S_SPECIAL_PROPERTIES.
ls_special_properties-image_source = '~Icon/Search'.
io_layout_config->add_button_row_element(
EXPORTING
iv_display_type = 'BT' " Action Display Type for Toolbar
iv_index = 1
iv_text = 'Button Text'
is_special_properties = ls_special_properties " Special Properties for UI Elements
it_element_action = lt_action " Actions in Configuration
iv_br_id = lv_br_id ). " FPM: Element ID
Hope it will helps you.
Regards,
Naga
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you provide the code from both GET_DEFINITION & GET_DEFAULT_CONFIG?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Method IF_FPM_GUIBB_LIST~GET_DEFINITION
------------------------------------------------------------------------
DATA: ls_action TYPE fpmgb_s_actiondef.
ls_action-id = 'CUSTOM'.
* ls_action-text = 'Custom'.
ls_action-enabled = abap_true.
ls_action-visible = '02'.
ls_action-imagesrc = '~Icon/Search'. "I Caps S Caps
* ls_action-action_type = '0'.
ls_action-tooltip = 'Custom Button'.
APPEND ls_action TO et_action_definition.
Method: IF_FPM_GUIBB_LIST~GET_DEFAULT_CONFIG
---------------------------------------------------------------------------------
DATA: lv_event TYPE fpm_element_id.
DATA: lt_action TYPE fpmgb_t_action,
ls_action TYPE fpmgb_s_action,
lv_br_id TYPE fpm_element_id.
DATA: lr_err TYPE REF TO cx_fpm_configuration.
lv_br_id = io_layout_config->add_button_row( ).
* Insert new button
ls_action-event_id = 'CUSTOM'.
ls_action-index = 1.
ls_action-text = 'Button Text'.
APPEND ls_action TO lt_action.
CLEAR ls_action.
TRY.
io_layout_config->add_button_row_element(
EXPORTING
iv_display_type = 'BT' " Action Display Type for Toolbar
iv_index = 1
iv_text = 'Button Text' " Web Dynpro: Configuration: Translatable Text
it_element_action = lt_action " Actions in Configuration
iv_br_id = lv_br_id ). " FPM: Element ID )
CATCH cx_fpm_configuration INTO lr_err. " Configuration exceptions
ENDTRY.
I used the following code with SFLIGHT structure:
METHOD if_fpm_guibb_list~get_definition.
DATA lt_data TYPE STANDARD TABLE OF sflight.
FIELD-SYMBOLS <fs_field> like LINE OF et_field_description.
DATA: ls_action TYPE fpmgb_s_actiondef.
ls_action-id = 'CUSTOM'.
ls_action-enabled = abap_true.
ls_action-visible = '02'.
ls_action-imagesrc = '~Icon/Search'.
ls_action-tooltip = 'Custom Button'.
APPEND ls_action TO et_action_definition.
eo_field_catalog ?= cl_abap_tabledescr=>describe_by_data( p_data = lt_data ).
APPEND INITIAL LINE TO et_field_description ASSIGNING <fs_field>.
<fs_field>-name = 'CARRID'.
<fs_field>-visibility = '02'.
ENDMETHOD.
METHOD if_fpm_guibb_list~get_default_config.
TRY .
CALL METHOD io_layout_config->add_column
EXPORTING
iv_name = 'CARRID'
iv_display_type = if_fpm_guibb_constants=>gc_display_type-text_view " Display Type
iv_index = 1
iv_header = 'Airline Code'.
CATCH cx_fpm_configuration. " Configuration exceptions
ENDTRY.
DATA: lv_event TYPE fpm_element_id.
DATA: lt_action TYPE fpmgb_t_action,
ls_action TYPE fpmgb_s_action,
lv_br_id TYPE fpm_element_id.
DATA: lr_err TYPE REF TO cx_fpm_configuration.
lv_br_id = io_layout_config->add_button_row( ).
* Insert new button
ls_action-event_id = 'CUSTOM'.
ls_action-index = 1.
ls_action-text = 'Button Text'.
APPEND ls_action TO lt_action.
CLEAR ls_action.
TRY.
io_layout_config->add_button_row_element(
EXPORTING
iv_display_type = 'BT' " Action Display Type for Toolbar
iv_index = 1
iv_text = 'Button Text' " Web Dynpro: Configuration: Translatable Text
it_element_action = lt_action " Actions in Configuration
iv_br_id = lv_br_id ). " FPM: Element ID )
CATCH cx_fpm_configuration INTO lr_err. " Configuration exceptions
ENDTRY.
ENDMETHOD.
Then in component config just assigned feeder class, there should be no actions and field assigned in config, if there are remove them.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
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.