on 09-13-2007 1:01 PM
Hi experts,
I experience a strange behaviour with my model, the following iterator loop never gets called, despite the fact that "wdContext.nodeFindReturn()" is filled with many elements.
When I set a breakpoint before the loop, and inspect the context via the context debug viewer everything works as expected.
I guess by inspecting the context something in the context changes, which causes the iterator to work, any hints?
wdContext.nodeCustomerList().invalidate();
Iterator iter = wdContext.nodeFindReturn().iterateElements();
while (iter.hasNext())
{
IWDNodeElement source = (IWDNodeElement) iter.next();
IWDNodeElement destination = wdContext.nodeCustomerList().createAndAddCustomerListElement();
WDCopyService.copyCorresponding(source, destination);
}
regards,
christian
Hi,
Try it the old way:
wdContext.nodeCustomerList().invalidate();
int size = wdContext.nodeFindReturn().size();
for(int i = 0; i < size; i++)
{
IWDNodeElement source = wdContext.nodeFindReturn().getFindReturnElementAt(i);
IWDNodeElement destination = wdContext.nodeCustomerList().createAndAddCustomerListElement();
WDCopyService.copyCorresponding(source, destination);
}
Regards,
Satyajit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Why cant use "for" loop to get the elements and copy corresponding elements to another node.
Regards
Akshaya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
In that case you may also try iterarteChildren() method that will give you all the nodes
Regards
Avinash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
I think since this is a node...you may also use iterateAttributes() method to iterate through a node.
Thanks
Avinash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.