cancel
Showing results for 
Search instead for 
Did you mean: 

Check Box

Former Member
0 Kudos

Hi All,

I am new to Web dynpro , and the clarification i needed is .. I have created a two input fields Account,Net price and a check box. I am maintaing the values in the custom table and now if the user enters a valid account it checks the table and if the net price entered by the user is greater than the value present in the table the *checkbox should be grayed out and it should be ticked

.*As of now i have created the layout and i have defaulted the check box to ABAP _true... after entering the details and the user unticks the check box, the method of the On Toggle in check box will be runned and in that i have written

WD_NODE->SET_ATTRIBUTE( EXPORTING NAME = 'ENABLED'

VALUE = ABAP _FALSE ).

now i am getting with this the check box grayed out but the check box is not ticked ......... i want the check box to be grayed out and ticked as well.....

Accepted Solutions (1)

Accepted Solutions (1)

former_member206441
Contributor
0 Kudos

Hi

Create two attributes var1 type string,

var2 type wdy_bolean.

bind the enable property of the checkbox to var2 and checked property to attribute var1.

Just get the account number, net price from the user

and get the total from the table by comparing the account number of the table.

if the total is less then the user entered net price do this

if total_price < net_price

call the attribute var1 and var2 from code wizard and set the

property of var2 value to ' '. "to disable the checkbox

and set the property of var1 to 'X' "checkbox to be ticked

Regards

Arun.P

Answers (1)

Answers (1)

Former Member
0 Kudos

hi

i want the check box to be grayed out and ticked as well.....

u bind ur Check Box to a context attribute of type WDY_BOO'LEAN

in the OnToggle event of ur Checkbox , set this attribute to 'X to make the checkbox ticked

in the OnToggle event of ur Checkbox , set this attribute to ' ' to make the checkbox un ticked


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_ATTR`

        value = 'X' ).
// set attribute CA_ATTR under CN_NODE to 'X' 
// this is a code generated thru code wizard ( control +f7) , read context node/attribute
// use SET_ATTRIBUTE method

regards,

amit