cancel
Showing results for 
Search instead for 
Did you mean: 

how to disbale a group of checkboxes when i select one check box WEBDYNPRO

Former Member
0 Kudos

Hi Friends,

Can any body help me how to disbale a group of checkboxes when i select one check box WEBDYNPRO Abap

.

Also can any body tell me how to handle chain endchain type of scenario in WEBDYNPRO Abap

Thank you..

Sai

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

In the context tab , create 2 context attributes ca_attr1 and ca_attr2 of type WDY_BOOLEAN under a context node cn_node

now in ur Layout , bind the ENABLE property of CheckBoxGroup UI Element with this attribute ca_attr1

bind the ENABLE property of CheckBox UI Element with this attribute ca_attr2

create a action for ur Checkbox , for the OnToggle property of ur checkbox

in OnactionToggle , check if ca_attr2 is 'X' , set ca_attr2 to ' ' ( for disable)

this can be done by code wizard , press control +f7 and use read/set context attributes , use get_attribute and set_attribute methods


// if ca_attr2 is 'X'
DATA lo_nd_cn_node TYPE REF TO if_wd_context_node.
    DATA lo_el_cn_node TYPE REF TO if_wd_context_element.
    DATA ls_cn_node TYPE wd_this->element_cn_node .
    DATA lv_attr  LIKE ls_city-ca_attr2.

    lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_ca_attr).
 
*   get element via lead selection
    lo_el_cn_node = lo_nd_cn_node->get_element(  ).
 
*   get single attribute
    lo_el_cn_node->get_attribute(
      EXPORTING
        name =  `CA_ATTR2`
      IMPORTING
        value = lv_attr ).
// if lv_attr2 is 'X' , use set_attribute method for ca_attr1
IF lv_Attr EQ 'X' .
DATA lo_nd_cn_node TYPE REF TO if_wd_context_node.
    DATA lo_el_cn_node TYPE REF TO if_wd_context_element.
    DATA ls_cn_node TYPE wd_this->element_cn_node .
    DATA lv_attr  LIKE ls_city-ca_attr.
*   navigate from <CONTEXT> to <CN_VISIBLE> via lead selection
    lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_ca_attr).
 
*   get element via lead selection
    lo_el_cn_node = lo_nd_cn_node->get_element(  ).
 
*   set single attribute
    lo_el_cn_node->set_attribute(
      EXPORTING
        name =  `CA_ATTR1`
        value = ' ').
ENDIF.

regards,

amit

Former Member
0 Kudos

Hi Amit,

While creating check boxes in my layout I just placed them in a group element rather than CheckboxGroup element. Could you please explain elaborately in this scenario. My issue is when one check box is checked other checkboxes should be unchecked and should greyed out as well..

Thank you for your response.

Former Member
0 Kudos

Hi Amit,

Also after following the same process those fields that

I have bind to the ENABLE property those fileds are greyed out in the screen with no input..I need these greyed out only after I select the check box and others should be greyed out. but here intially I enter into screen itself it is greyed out

thanks..

Former Member
0 Kudos

Hi Sai Prasadh,

I believe you wrote this enable logic in WDDOINIT, please change your logic into WDDOMODIFYVIEW, before this logic just use the condition that your first check box is selected or not.

I hope this will help you...if not please let me know.

Thanks..

Naresh

Former Member
0 Kudos

Hi Sai Prasadh,

I believe you wrote this enable logic in WDDOINIT, please change your logic into WDDOMODIFYVIEW, before this logic just use the condition that your first check box is selected or not.

I hope this will help you...if not please let me know.

Thanks..

Naresh

Former Member
0 Kudos

hi ,

in ur group , u have checkboxes ..

create context atributes ( of type WDY_BOOLEAN) as many as the checkboxes in ur layout under a context node

bind the enable property of the checkbox UI to these attributes

read the context attributes using code wizard ( CONTROL +F7)


// suppose u have 3 checkboxes , n u have got the values in the varibles lv_attr1 , lv_attr2 and lv_attr3 using 
// get_attribute method
// put this IF condition and use set_attribute method
IF lv_attr1 NE 'X' .
// set context attribute to  ' ' ( this means blank)
DATA lo_nd_cn_node TYPE REF TO if_wd_context_node.
    DATA lo_el_cn_node TYPE REF TO if_wd_context_element.
    DATA ls_cn_node TYPE wd_this->element_cn_node .
    DATA lv_attr  LIKE ls_city-ca_attr.
*   navigate from <CONTEXT> to <CN_VISIBLE> via lead selection
    lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_ca_attr).
 
*   get element via lead selection
    lo_el_cn_node = lo_nd_cn_node->get_element(  ).
 
*   set single attribute
    lo_el_cn_node->set_attribute(
      EXPORTING
        name =  `CA_ATTR1`
        value = ' ').
ENDIF.
// similarly put the check condition for lv_attr2 nd lv_attr3

regards,

amit

aaron_morden2
Contributor
0 Kudos

Create a context attribute of type WDY_BOOLEAN and bind it to the enabled property of your CheckBoxGroup UI Element.

Create an action when the check box is checked. In your action handler, you can set your context attribute to either ABAP_TRUE for enable or ABAP_FALSE for disabled.