cancel
Showing results for 
Search instead for 
Did you mean: 

Hiding UI Elements

Former Member
0 Kudos

HI All,

How to hide UI Element(input field),while selecting item from drop down UI element.

Thanks

Accepted Solutions (0)

Answers (3)

Answers (3)

p330068
Active Contributor
0 Kudos

Dear Vagdevimallaaa

Play with WDVisibility in you WD Code based on your requirement and drop down UI element to make input field visible or none.

Best Regards

Arun Jaiswal

Former Member
0 Kudos

Thanks i got solution

Qualiture
Active Contributor
0 Kudos

There are numerous threads regarding this, have you already searched the forum?

Anyway, 1) Bind the 'visible' property of both the label and the input field to a context attribute of type com.sap.ide.webdynpro.uielementdefinitions.Visibility

2) In the event handler of the onSelect of your dropdown, evaluate the value of your dropdown. Based on the selection, set the context attribute to either WDVisibility.VISIBLE or WDVisibility.NONE

vijay_kumar49
Active Contributor
0 Kudos

Hi,

Please look this code

1.Create one Droupdownkey UI element in your firstView (Droupdown is bind to the one value attribute i.e MonthName)along this u can take 2 lable. For 2 lables you can set Visibility (com.sap.ide.webdynpro.uielementdefinitions.Visibility) property.

2. in wdintint method you can write this code


ISimpleTypeModifiable myType=wdThis.wdGetAPI().getContext().getModifiableTypeOf("MonthName");  
IModifiableSimpleValueSet values =myType.getSVServices().getModifiableSimpleValueSet();
values.put("123","123");
values.put("XYZ","XYZ");  
wdContext.currentContextElement().setMonthName("123");
wdContext.currentContextElement().setXYZ(WDVisibility.NONE);  
wdContext.currentContextElement().set123(WDVisibility.NONE);

3.in Droupdownby key having OnSelect event in that place you can create on method. Under method you can write this code.


String firstName = wdContext.currentContextElement().getMonthName();
wdComponentAPI.getMessageManager().reportSuccess("First Name:"+firstName);
String lastName = wdContext.currentContextElement().getMonthName();
wdComponentAPI.getMessageManager().reportSuccess("Last Name:"+lastName);
if(firstName.equalsIgnoreCase("123"))
{
wdContext.currentContextElement().setXYZ(WDVisibility.VISIBLE);  
wdContext.currentContextElement().set123(WDVisibility.NONE);
}
else
{
wdContext.currentContextElement().set123(WDVisibility.VISIBLE);
wdContext.currentContextElement().setXYZ(WDVisibility.NONE);
}

Hope this helps!!

Best Regards

Vijay K