cancel
Showing results for 
Search instead for 
Did you mean: 

dropdown by key

Former Member
0 Kudos

Hi ,

I am working on Webdynpro ABAP application . I want to enable button on the value of the drop down.

Could any one help me on this. I have done following steps

1.Created onselect action for dropdown by key

2.Created context attribute with wdy_boolean type.

3. checking in the on select action if the value is entered and then seting attribute to 'X'

but still not working

Thanks

K

Accepted Solutions (1)

Accepted Solutions (1)

arjun_thakur
Active Contributor
0 Kudos

Hi Kiran,

Check if you have done the following steps:

- create an onselect method for drop down.

- create a context attribute of wdy_boolean type and bind it with the enabled property of the button.

- in the onselect method of the drop down, read the attribute that is binded to the drop down.

Check if it is not initial, set the value of the attribute as 'X'.

If still it is not working, Put a break point in the onselect method and see if that method is getting triggered.

Regards

Arjun

Former Member
0 Kudos

Hi Arjun,

Yes i tried displaying one textview with the selected value in drop down .It is working fine.

Could you please help me more on this.

Thanks

K

arjun_thakur
Active Contributor
0 Kudos

Sorry, I didn't understand your question. Do you want to display the selected value in the text view?

Regards

Arjun

Edited by: Arjun Thakur on Mar 10, 2009 1:53 PM

Former Member
0 Kudos

Hi Arjun,

No, I want to make the button enable only if say drop down value selected is "X"

Thanks

K

arjun_thakur
Active Contributor
0 Kudos

Hi Kiran,

Refer this code


method ONACTIONONSELECT .

      DATA lo_nd_cn_visa TYPE REF TO if_wd_context_node.

    DATA lo_el_cn_visa TYPE REF TO if_wd_context_element.
    DATA ls_cn_visa TYPE wd_this->element_cn_visa.
    DATA lv_ca_visa TYPE wd_this->element_cn_visa-ca_visa.

*   navigate from <CONTEXT> to <CN_visa> via lead selection
    lo_nd_cn_visa = wd_context->get_child_node( name = wd_this->wdctx_cn_visa ).

*   get element via lead selection
    lo_el_cn_visa = lo_nd_cn_visa->get_element( ).
*   @TODO handle not set lead selection
    IF lo_el_cn_visa IS INITIAL.
    ENDIF.

*   get single attribute
    lo_el_cn_visa->get_attribute(
      EXPORTING
        name =  `CA_visa`
      IMPORTING
        value = lv_ca_visa ).

if lv_ca_visa eq 'X'. " I am assuming that the value which is selected in drop down has a key 'X'.

    DATA lo_el_context TYPE REF TO if_wd_context_element.
    DATA ls_context TYPE wd_this->element_context.
    DATA lv_ca_enable TYPE wd_this->element_context-ca_enable.

*   get element via lead selection
    lo_el_context = wd_context->get_element( ).

*   @TODO handle not set lead selection
    IF lo_el_context IS INITIAL.
    ENDIF.

*   set single attribute
    lo_el_context->set_attribute(
      name =  `CA_ENABLE`
      value = 'X' ).

    endif.

endmethod.

I hope it helps.

Regards

Arjun

Former Member
0 Kudos

HI Arjun,

Thanks it is working fine. You was right there was some other action getting triggered.

Regards

K

Answers (0)