cancel
Showing results for 
Search instead for 
Did you mean: 

make UI invisible dynamically

Former Member
0 Kudos

hi all,

I have a drop down box. Based on the element selected in the drop down the corresponding data should be displayed at the bottom. But the data of the last column should be displayed in inputfield/textedit/dropdown based on the indicator.I will place these UI elements in the last column.The other UI elements should be invisible. Only one UI element should be visible at a time.

Can we achieve this? or Is there any other way where in i can achieve this?

Thanks in advance,

Gopi

Accepted Solutions (1)

Accepted Solutions (1)

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi Gopi,

Steps of UI element invisible dynamically

1. Create value attribute type of visiblity.

2. Assign the value attribute to UI element visible properties.

3. on select event make the UI elements visible or None as per your need.

Regards, Suresh KB

Answers (1)

Answers (1)

Former Member
0 Kudos

Add 3 calculated attributes (type = com.sap.ide.webdynpro.uielementdefinitions.Visibility, readOnly=true) to the context:

Context
-- InputFieldVisibility
-- TextEditVisibility
-- DropDownVisibility

Bind the "visible" property of the different UI elements to the corresponding attribute e.g. InputField.visible -> InputFieldVisibility.

You will get 3 get-methods. Implement them according to the following scheme:


WDVisibility getInputFieldVisibility(IContextElement element)
{
  int selectedIndex = wdContext.node<Node>().getLeadSelection(); /* for DDByIndex */
  String selectedKey = wdContext.currentContextElement().getSelectedKey(); /* for DDByKey */
  return (<input-field-visible-for-selection>)
    ? WDVisibility.VISIBLE
    : WDVisibility.NONE;
}

Armin