cancel
Showing results for 
Search instead for 
Did you mean: 

On basis of drop down by key values i want to enable and disable ui elements is wda

Former Member
0 Kudos

How to enable and disable ui elements on basis of drop down by key values as i show in screen shot i have 3 values in drop down by key on basis of those values i need to enable and disable ui elements in webdynpro abap kindly reply back

Accepted Solutions (1)

Accepted Solutions (1)

amy_king
Active Contributor
0 Kudos

Hi Sreedhara,

The DropDownByKey element has an event, onSelect, that you can use to enable or disable the other UI elements. Simply bind the enabled property of the UI elements to a context attribute of type wdy_boolean, then in the event handler method for event onSelect, set the bound context attribute value to true or false.

Cheers,

Amy

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi am unable to fix my problem kindly provide the coding part how to control the ui elements enable and disable on basis of drop down by key . right now i am able to display all ui elements at once means enable and disable at once how to control them . by using the case end case we can do it .....? if it can u please provide pseudo code for that at least .

Thanks in advance kindly reply back any once today i need to close this issue .

amy_king
Active Contributor
0 Kudos

Hi Sreedhara,

There are many tutorials on SCN for learning Web Dynpro ABAP. If the following steps don't make sense to you, please do a search for some tutorials and read through the tutorial materials. Hopefully the tutorials will help you to become familiar with some of the basics of Web Dynpro ABAP.

Here is how to enable or disable a UI element upon selection from a DropDownByKey.

  1. In your view context, create a context attribute of type wdy_boolean. For now, let's call this attribute IS_ENABLED
  2. In your view layout, bind the enabled property of the UI element to the context attribute IS_ENABLED.
  3. In your view actions, create an action-- let's call it SET_ENABLED-- and bind this action to the DropDownByKey element's onSelect event in the view layout.
  4. In the event handler method for the SET_ENABLED action, use the Code Wizard to read the value of the DropDownByKey selected value, then use the Code Wizard again to set the value of context attribute IS_ENABLED to either true or false.

Now when a value is selected from the DropDownByKey, the SET_ENABLED action will be triggered and the IS_ENABLED context attribute will be set to either true or false. Since your UI element's enabled property is bound to this true or false value via the context binding, the UI element will change to enabled or disabled.

Good luck!

Cheers,

Amy

Former Member
0 Kudos

Hi Amy thanks lot i solved my problem i took wdy_boolean ui element and bind to the enable property and on basis of the drop down by key i enable and disable my ui elements . amy u r psedo code was very much help full for resolving my problem .

Regards

Kaggal sreedhara

Former Member
0 Kudos

Hi Ram can u please provide one example with coding part that will be more help full for me

Former Member
0 Kudos

Thanks amy and ram can u please provide some example with coding that will be more helpful for me .

former_member184578
Active Contributor
former_member197475
Active Contributor
0 Kudos

Hi Sreedhara,

As Amy told you can control the UI element behaviour using OnSelect event of DropDownByKey.

But keep in remember, handle the else condition perfectly.

BR,

RAM.