cancel
Showing results for 
Search instead for 
Did you mean: 

Hide label of dynamically created input field

former_member184111
Active Contributor
0 Kudos

Hi Forum,

I am working on SRM 7. I have created an inputfield in RFx UI using meta data now I want to hide the Lable of this input field.

This can be done by enhancing the WDDOMODIFYVIEW in the view but how to get the reference of lable from inputfield?

Please note that these UI elements are generated at runtime and will not be there in layout.

Thanks,

Anubhav

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member186055
Active Participant
0 Kudos

Hi Anubhav,

Please check below code,

   DATA lo_nd_node_radio1   TYPE REF TO if_wd_context_node.

   DATA lo_el_node_radio1   TYPE REF TO if_wd_context_element.

   DATA lw_index            TYPE i.

   DATA lo_el_node_radio1_1 TYPE REF TO if_wd_context_element.

   DATA lo_el_context TYPE REF TO if_wd_context_element.

   DATA ls_context TYPE wd_this->element_context.

   DATA lv_first_name_lbl_vis TYPE wd_this->element_context-first_name_lbl_vis.

  lo_el_node_radio1_1 = wd_context->get_element).

*     @TODO fill attribute to Disable field label...

      lv_first_name_lbl_vis = 01.

*     set single attribute

       lo_el_context->set_attribute(

         name `FIRST_NAME_LBL_VIS`         " Label Attribute name

         value = lv_first_name_lbl_vis ).

*     @TODO fill attribute to enable field label...

      lv_first_name_lbl_vis = 02.

*     set single attribute

       lo_el_context->set_attribute(

         name `FIRST_NAME_LBL_VIS`        " Label Attribute name

         value = lv_first_name_lbl_vis ).

*" call method set attribute property and pass value as 'X' to show

     CALL METHOD lo_el_node_radio1_1->set_attribute_property

       EXPORTING

         attribute_name = 'FIRST_NAME_1'     " InputField Attribute name

         property       = 1

         value          = 'X'.

*" call method set attribute property and pass value as SPACE to HIDE

     CALL METHOD lo_el_node_radio1_1->set_attribute_property

       EXPORTING

         attribute_name = 'FIRST_NAME_1'         " InputField Attribute name

         property       = 1

value          = space.


Regards,

SuryaPraveen