cancel
Showing results for 
Search instead for 
Did you mean: 

Looping over context automatically?

Former Member
0 Kudos

Hi,

I need to create something like a bill. Every position in the bill contains of several lines.

From my context structure I have a node positions with some data value (headerdata for the position) and a node lines with again dome data.

I would now like to show the Bill data. With a table the design is too restricted, as I need per position several lines.

I thought of grouping the view elements bound to lines and positions. What I need is an WD Element that now loops automatically over my context and shows as many groups as I have in my context as the table does...

Is there something like that, I think not?? If someone knows struts I think what I need is the equivalent of <logic:iterate>... Normally a basic...

Can I generate this dynamically then? But how do I assign one group the values of an entry in my context collection then (that line 3 shows the third element in my context?). What I naturally can do is to bind the Text directly, so read it from context and set it in textview element

Thanx for any answers,

Frank

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

In wdDoModifyView(), loop over the node element collection.

For each node element: create some UI elements that will display this element and set their property values from the node element. This will probably go into a separate method or helper class.

Put the dynamically generated UI elements in a common container and do a container.destroyAllChildren() before adding them.

Armin

Former Member
0 Kudos

> Put the dynamically generated UI elements in a common

> container and do a container.destroyAllChildren()

> before adding them.

>

That was of what I thought is to do... Of what purpose is the destroyAllChildreen() ?

Thanx,

Frank

Former Member
0 Kudos

(removed)

Former Member
0 Kudos

It destroys all children of a container

If you want to add new children to a container several times, this is a simple way to clean-up the container before adding new children. By destroying view elements, their instances are completely removed from the view and the ID's may be used again.

Armin

Former Member
0 Kudos

Sorry, I misunderstood you... I thought I had to create them in wdDoModifyView and at the end I should use this method to destroy them again. That sound a little bit senseless...

I hope I can figure it out now, but from SAP side I would think about some view container that shows all elements of a node in a context - in fact like a table does but not with this strict design.

Lets say something like a WDGroup with databinding like a table. This group shows its child as often as you have elements in the context node, but you can design more freely the elements.

Should not be such a problem to derive that from a Table

Thanx for your help again.

Frank

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

As per my understanding i have a guess that TreeByNestingTableColumn property will work.

Using this on click on a node element data we can view the child elements data in that table itself.

Try this link...

/people/valery.silaev/blog/2005/06/20/master-of-columns-part-ii

Regards

Bharathwaj

Former Member
0 Kudos

Hi,

Is ur requirement like

-nodea

---Nodeb

---value1

---value2

and for each nodea, there are a set of values in nodeb.?

Is my understanding correct?

regards

Bharathwaj

Former Member
0 Kudos

> Hi,

>

> Is ur requirement like

>

> -nodea

> ---Nodeb

> ---value1

> ---value2

>

> and for each nodea, there are a set of values in

> nodeb.?

You mean to use a tree?

It more like something:


NodeA           NodeA.value1     NodeA.value2
        NodeA.line1.valueA  NodeA.line1.valueB  
        NodeA.line2.valueA  NodeA.line2.valueB
----------------------------------------------
NodeB   ...

Frank