on 01-03-2012 2:47 PM
Hi all,
I have a lable and a inputfield which are hide. I want that when a select something in my dropdownbykey, this two objects get visible.
How can i do that?
Regards,
Nirali
Hi Nirali,
Try creating a visibility simple data type with Boolean data type. Now assign this variable to the input field for visibility property. Then set the visibility manually using the following code.
wdContext.currentContextElement.setVisibility(Visible.<boolean data type>);
this code has to be written within the onAction event of dropdownbykey.
Hope it helps.
Regards
Uday
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please look this code
1.Create one Droupdownkey UI element in your firstView (Droupdown by key 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 wdinit() method you can write this code
ISimpleTypeModifiable myType=wdThis.wdGetAPI().getContext().getModifiableTypeOf("MonthName");
IModifiableSimpleValueSet values =myType.getSVServices().getModifiableSimpleValueSet();
values.put("Vijay","Vijay");
values.put("Kalluri","Kalluri");
wdContext.currentContextElement().setMonthName("Vijay");
wdContext.currentContextElement().setKalluri(WDVisibility.NONE);
wdContext.currentContextElement().setVijay(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("Vijay"))
{
wdContext.currentContextElement().setKalluri(WDVisibility.VISIBLE);
wdContext.currentContextElement().setVijay(WDVisibility.NONE);
}
else
{
wdContext.currentContextElement().setVijay(WDVisibility.VISIBLE);
wdContext.currentContextElement().setKalluri(WDVisibility.NONE);
}
Hope this helps u.
Best Regards
Vijay K
Edited by: VijaySAPEP on Jan 4, 2012 4:47 PM
Edited by: VijaySAPEP on Jan 4, 2012 7:32 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi experts,
I solved my problem by creating all the things you all told me.
I also found this tutorial that seems to be what i was looking for: http://wiki.sdn.sap.com/wiki/display/WDABAP/SetvisibilityofbuttondynamicallyinWebDnproABAP
Thanks to help me solve out the problem.
Regards,
Nirali
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.