cancel
Showing results for 
Search instead for 
Did you mean: 

How do you make UI elements visible or not visible based on some condit

Former Member
0 Kudos

Hi,

Any one give reply in web dynpro UI elements visible or not visible based on some condition at runtime?

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member85655
Active Participant
0 Kudos

Hi Kumar,

Define a context attribute of type boolean.Map this to the "enabled" property of the UI element like the Input field. Now as you change the context value at rutime the property gets enabled/ diabled.

wdContext.nodeTest().enabledAttr(true);

or

wdContext.nodeTest().enabledAttr(false);

Hope this helps.

Regards,

Arun

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi,

Create value attribute as "sample"

select that "sample" value attribute->properties->

Click on type->type selection window will pop up

->Dictionary simple type ->com.sap.ide.webdynpro.uielementdefinitions->visiblity

bind this "sample" value attribute required to visible property of UI elements.

//wdDoInit()

wdContext.currentContextElement().set<ContextAttrName>(WDVisibility.NONE);

OnAction handler

wdContext.currentContextElement().set<ContextAttrName>(WDVisibilty.VISIBLE);

Again you can toggle between visible and non visible

Regards

Suresh

Former Member
0 Kudos

Hi,

bind the attribute type 'WDVisibility' to the visible property of the UIElements.

depends upon your condition you can show or hide the UIElement using WDVisibility.VISIBLE and WDVisibility.NONE

regards

karthik