Setting Layout Properties of a CHIP
Use
You can define the layout properties of a CHIP in the program code. These include:
-
Height
Here you enter the height of the CHIP as a string. Enter the number followed by px to ensure the height is displayed in pixels.
-
Padding
Here you can decide whether a padding is displayed in the CHIP.
-
Height can be stretched
Here you can decide whether the height of the CHIP is stretched if there is enough space on the page or in the line.
-
Full screen possible
You can decide whether the user can display the CHIP in full screen mode. In the options menu the entry Full Screen is shown, enabling the user to display this CHIP on the whole page.
-
Open in new window
Here you can decide whether a CHIP can be executed remotely. In the options menu the entry Open in New Window is shown.
-
Set Separate Tray Menu
You can set your own options menu for a CHIP.
-
Visibility
You can hide a CHIP in the personalization mode.
Procedure
Setting the Layout Property Dynamically
Using interface IF_CHIP_API you can implement these properties using the following methods:
-
SET_CHIP_PADDING
-
SET_CHIP_HEIGHT
-
SET_CHIP_STRETCH_HEIGHT
-
SET_EXEC_FULLSCREEN
-
SET_CUSTOM_TRAY_MENU
-
SET_PANEL_VISIBILITY
The source code could look like:
try.
wd_this->m_chip_api->set_chip_height( chip_height = chip_size_config-height ).
wd_this->m_chip_api->set_chip_stretch_height( chip_stretch_height = chip_size_config-stretch_height ).
wd_this->m_chip_size_config = chip_size_config.
catch cx_chip_size.
endtry.
wd_this->m_chip_api->set_chip_padding( abap_false ).
Setting the Layout Property Statically
You can set these properties statically with CHIP_PARAMETERS constants using interface IF_CHIP_DEFINITION.
-
CO_PARAM_EXECUTE_REMOTE
-
CO_PARAM_FULLSCREEN
-
CO_PARAM_CHIP_PADDING
-
CO_PARAM_CHIP_HEIGHT
-
CO_PARAM_CHIP_STRETCH_HEIGHT
For All CHIPs of a CHIP Provider
You can set these layout properties for all the CHIPs belonging to a CHIP provider. You can specify these properties in your CHIP_PROVIDER when you create the CHIP_DEFINITION. This could look like: CL_CHIP_PROVIDER_PFCG ->IF_CHIP_PROVIDER~GET_CHIP_DEFINITION.
ls_chip_parameter-name = if_chip_definition=>co_param_execute_remote.
ls_chip_parameter-value = abap_true.
insert ls_chip_parameter into table lt_chip_parameters.
create object chip_definition type cl_chip_definition
exporting
name = chip_name
display_names = lt_display_names
descriptions = lt_descriptions
icon = <ls_tree>-icon
chip_description = l_chip_description
chip_parameters = lt_chip_parameters
custom_parameters = lt_custom_parameters.
For the CHIPs of a Web Dynpro Component
In a Web Dynpro assistance class you can change the static CHIP_DEFINITION parameter using ABAP interface IF_CHIP_DEFINITION_MODIFIER.
data chip_parameter type chip_definition_parameter.
chip_parameter-name = if_chip_definition=>co_param_fullscreen.
chip_parameter-value = abap_true.
insert chip_parameter into table chip_parameters.
if sy-subrc = 4.
modify table chip_parameters from chip_parameter.
endif.