cancel
Showing results for 
Search instead for 
Did you mean: 

WebUI enhancement for view in display mode

0 Kudos

Hi,

My requirement was to open an overview page Preference Center in display only mode. Currently, few of the assignment blocks had editable fields and there was no edit button. Now the requirement is to open it in display only mode and only become editable after clicking edit button. I have to add an edit button besides the cancel button as well.

To achieve this, I have made changes to the view ZCUSTOMER_CPC/CusCPCVS where I have enhanced SET_VIEW_GROUP_CONTEXT with the below code:

IF iv_first_time EQ abap_true AND
me->view_group_context IS NOT BOUND.
IF iv_parent_context IS INITIAL.
CREATE OBJECT me->view_group_context
TYPE cl_bsp_wd_view_group_context.
ELSE.
me->view_group_context = iv_parent_context.
ENDIF.
ENDIF.

Also, I have added the below code to CusCPCVS.htm:

DATA: lv_xml TYPE string.
%>
<chtmlb:config xml = "<%= lv_xml %>"
displayMode = "<%= controller->view_group_context->is_view_in_display_mode( controller ). %>"
mode = "RUNTIME" />

Now, the issue is I have to enable the editing to the fields by clicking on the EDIT button. But, I am not able to make it editable. Please provide pointers on how to fix it. I have attached pictures of the views from UI and GUI. request you to please suggest if I am working on the right path.

prefcentreui2.pngprefcentregui.png

0 Kudos

One update : I have created an Event handler for the Edit button with the below code to enable all the fields which were disabled in Display mode. Please let me know if this is correct.

DATA: lr_bp_ent TYPE REF TO cl_crm_bol_entity,
lt_mktp_ent TYPE REF TO cl_crm_bol_entity.

lr_bp_ent ?= me->typed_context->standardaddress->collection_wrapper->get_current( ).
IF lr_bp_ent IS BOUND.
lr_bp_ent->switch_to_change_mode( ).
ENDIF.

lt_mktp_ent ?= me->typed_context->mktpref->collection_wrapper->get_first( ).
WHILE lt_mktp_ent IS BOUND.
lt_mktp_ent->switch_to_change_mode( ).
lt_mktp_ent ?= me->typed_context->mktpref->collection_wrapper->get_next( ).
ENDWHILE.

Accepted Solutions (0)

Answers (0)