cancel
Showing results for 
Search instead for 
Did you mean: 

Iterating the Child Nodes

Former Member
0 Kudos

Hi Everybody,

I have the following Context:

ParentNode

- ChildNode1

-Visible

- ChildNode2

-Visisble

-ChildNode3

-Visible

Similalry, I have 10 Child Nodes. Now I want to access the attribute "Visible" under each Child Node by iterating it. How to do that...?

My Scenario is, I am having 10 Tabs and Each Tab has 20 Tables, these UI elements are designed as static.

Now from R/3 I will receive No.Of tabs to be visible, for Example if TabVisible value is 5, then Only 5 tabas are visible out of 10. Then I will receive No. of Tables to be displayed in Each Tab, for example, in Tab1 - 8 ables; Tab2 - 5 Tables; Tab3-6 Tables. I have set the Visible Contest binded to each UI element. Now I wan to loop it to get the output structure.

So, I hae designed the Context structure as follows:

<b>Tab1</b> <b>(Parent Node)</b>

- <i>Table_1</i> <b> (Child Node)</b>

- Visible <b>(Attributes)</b>

- ColHeader

- <i>Table1_!</i>

-Visible

- ColHeader

- <i>Table2_1</i>

-Visible

-Tab1Visble <b>(Parent Node Attribute)</b>

<b>Tab2</b>

- <i>Table_2</i>

- Visible

.

.

It goes on like this...

Please give me solution for the above case...if possible code snippets..

Thanks in advance

Regards/Guru

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Kumara,

According to your specified requirement you have 10 Tabs and each Tab contains 20 Tables. So to control the visibility you first need to assign the Visibility Property of each individual tab/ table to different value nodes of type com.sap.ide.webdynpro.uielementdefinitions.Visibility. To control the visibility of the tables and tabs you can follow the context structure like this.

Tab1 ( Parent Value Node )

|....Visible ( Value attribute for Tab Visiblity )

|..........Table1 ( Child Value Node under Parent Node )

|......Visible ( Value attribute for table Visiblity )

|..........Table2

|......Visible

|..........Table3

|......Visible

|..........Table4

|......Visible

Once you assign the visible property of all your UI elements like (Tables, Tabs) you can very easiliy control the visibility of each individual Tab like Tab1 with the

following code.

wdContext.currentTab1Element().setVisible(WDVisibility.NONE);

and to control the visibility of each table under each Tab for example ( Table1 under Tab1 ) use this following code.

wdContext.createTable1Element().setVisible(WDVisibility.NONE);

I have tried my level best to help you.

Thanks and Regards

Avijit