cancel
Showing results for 
Search instead for 
Did you mean: 

Nested nodes

Former Member
0 Kudos

Hi,

I'm having a problem using nested nodes in Web DynPro. Consider the following context:


L Person
     L   Data
     L   Totals

The context is filled with data by calling a bapi. There are two scenario's for the application, one which should only display the output for one person, and one where the output contains data of all the persons in a team.

Every person has elements in Data, but for some Totals doesn't exist. When I execute this for one person, there is no problem. But when I do it for a team, with some persons having a Totals table and others not, the persons which shouldn't have a Totals table all get the same table belonging to another person.

I've made all my context nodes non-singletons and the minimum selection and minimum cardinality is 0 for the node Totals.

wdContext.currentPersonElement().nodeTotals()

should return null sometimes but it never does ...

Any idea?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I am not sure if I understand your problem correctly but with the following context structure


Person (node, c=0:n)
-- Data (node, c=0:n, singleton=false)
-- Totals (node, c=0:n, singleton=false)

you can access the totals for the person at index 3 using the following code


IPersonElement person = wdContext.nodePerson().getPersonElementAt(3);
ITotals totals = person.nodeTotals();
if (totals.size() == 0)
{
  /* no totals for this person */
}
else
{
  for (int i = 0; i < totals.size(); ++i)
  {
    ITotalsElement total = totals.getTotalsElementAt(i);
  }
}

Armin

Answers (0)