cancel
Showing results for 
Search instead for 
Did you mean: 

How to enable and disable UI elements

Former Member
0 Kudos

Hi,

My requirement is to enable and disable some UI elements based on user selection.

Assume I have two radio buttons ( male and female). If user selects male button, i have to enable and display 5 UI elements(for ex.) to the user in the screen and if user selects female buttion, i have to disable the 5 UI elements displayed earlier and to display other set of UI elements.

Please let me know how I can achieve this in web dynpro.

Thanks in Advance.

Regards,

Venkat.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Each UI element has a property named "enabled". Bind this property to a boolean context attribute. Then you can control the enabling-state by changing the context attribute value.

Armin

Former Member
0 Kudos

Hello Armin,

Thanks so much for your answer. One of my requirement is fulfilled by your answer.

But to add to my last question, i want to completely hide those 5 UI elements when the user chooses Male Radio button.

How do i achieve this via Web Dynpro.

Once again thanks for your quick response.

Regards,

Venkat

Former Member
0 Kudos

Each UI element has a "visible" property. Create a context attribute of DDIC type "com.sap.ide.webdynpro.uielementdefinitions.Visibility". Then you can control the visibility by setting the attribute value.

At runtime, use the enumeration values from type WDVisibility.

Armin

Former Member
0 Kudos

Armin,

Thanks for the input and my requirement is fulfilled now.

Regs/Venkat

Answers (0)