cancel
Showing results for 
Search instead for 
Did you mean: 

at selection-screen output functionality in wd..

Former Member
0 Kudos

Hi all,

I've two checkboxes and two input fields. If i click the first checkbox the second input field should disable and if i click the second one first input field should disable. Is it possible to implement this logic in webdynpro? I'm new to webdynpro..please explain me with a sample code..Useful reply will be rewarded high points.

Regards

Mahathi

Accepted Solutions (1)

Accepted Solutions (1)

arjun_thakur
Active Contributor
0 Kudos

Hi mahathi ,

You can refer to standard component WDR_TEST_EVENTS. This will give you a very good idea about checkboxes.

I hope it helps.

Regards

Arjun

Answers (1)

Answers (1)

pranav_nagpal2
Contributor
0 Kudos

Hi,

this is very much possible....

bind the checked property of your checkbox with any boolean attribute.... value in this attribute will come automatically when you check or uncheck the check box.... now create an event and bind with on toggle event of check box..... this event will be called when you check or uncheck the check box..... now depending on the boolean attribute set the enable property of input field....

check the code below.....

method ONACTIONCB2 .

    DATA lo_el_context TYPE REF TO if_wd_context_element.
    DATA ls_context TYPE wd_this->element_context.
    DATA lv_cb1 LIKE ls_context-cb2.
*   get element via lead selection
    lo_el_context = wd_context->get_element(  ).

*   get single attribute
    lo_el_context->get_attribute(
      EXPORTING
        name =  `CB2`
      IMPORTING
        value = lv_cb1 ).



  DATA lv_ip1 LIKE ls_context-ip1.
* get element via lead selection
  lo_el_context = wd_context->get_element(  ).

if lv_cb1 eq ABAP_FALSE.
* set single attribute
  lo_el_context->set_attribute(
    EXPORTING
      name =  `IP1`
      value = ABAP_TRUE ).

ELSEIF lv_cb1 eq ABAP_TRUE.
* set single attribute
  lo_el_context->set_attribute(
    EXPORTING
      name =  `IP1`
      value = ABAP_FALSE ).
endif.
endmethod.

regards

Pranav