It's all about the answers!

Ask a question

Adding child iteration as first child?


Andy Berner (61127) | asked Apr 23 '11, 5:21 p.m.
To add a child iteration, there are two methods: IIteration::addChild(IIteration newChild) which creates a new iteration as the last child, and IIteration.insertChildAfter(IIteration newChild, IIteration afterThis) (actually, I'm not sure of the order of the parameters).

How do you add a child as the FIRST child of an iteration if there are already other children? I found out how to do it in the GUI---you pick the parent as the "new parent" rather than using the sibling function. But how do you do it through the Java api?

2 answers



permanent link
Geoffrey Clemm (30.1k33035) | answered Apr 24 '11, 3:05 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Just taking a guess, have you tried passing in a null parameter for
afterThis?

Cheers,
Geoff

On 4/23/2011 5:23 PM, ajberner wrote:
To add a child iteration, there are two methods:
IIteration::addChild(IIteration newChild)
which creates a new iteration as the last child, and
IIteration.insertChildAfter(IIteration newChild,
IIteration afterThis)
(actually, I'm not sure of the
order of the parameters).

How do you add a child as the FIRST child of an iteration if there are
already other children? I found out how to do it in the GUI---you
pick the parent as the "new parent" rather than using the
sibling function. But how do you do it through the Java api?

permanent link
Martha (Ruby) Andrews (3.0k44351) | answered Apr 25 '11, 7:44 p.m.
JAZZ DEVELOPER
The javadoc supports Geoff's guess:

"If the anchor is
* <code>null</code> the element is added at the beginning of the list.
*
* @param child a handle for the new child
* @param anchor the current child
"
If this method is not adding the anchor correctly, please file a defect against the Process component so we can look into it.

Thanks,
Martha
Jazz Developer, Process Component

Just taking a guess, have you tried passing in a null parameter for
afterThis?

Cheers,
Geoff

On 4/23/2011 5:23 PM, ajberner wrote:
To add a child iteration, there are two methods:
IIteration::addChild(IIteration newChild)
which creates a new iteration as the last child, and
IIteration.insertChildAfter(IIteration newChild,
IIteration afterThis)
(actually, I'm not sure of the
order of the parameters).

How do you add a child as the FIRST child of an iteration if there are
already other children? I found out how to do it in the GUI---you
pick the parent as the "new parent" rather than using the
sibling function. But how do you do it through the Java api?

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.