Skip to Content
0
Former Member
Oct 01, 2009 at 11:28 PM

Reordering of the nodeelements of a node

21 Views

Hi All,

Lets say i have a node Test with cardinality 1..n with some attributes name and city,Now lets say the test node size is 10;so this has nodeelement0,nodeelement1,nodeelement2...nodeelement9. so this order will be displayed in view if we attach this to table, but i want to reorder these nodelements of Test node like nodeelement2,nodeelement7,nodeelement1,nodeelement4...nodeelement0 . so my first row of table will be in this order.

i tried swapElements and moveElement of IWDNode but could not find the solution.

for(int i=0;i<n1;i++)

{

ITestElement elementAtI=wdContext.nodeTest().getTestElementAt(i);

if(elementAtI.getName().equalsIgnoreCase("k0"))

{

wdContext.nodeTest().moveElement(i,9);

}

else if(elementAtI.getName().equalsIgnoreCase("k2"))

{

wdContext.nodeTest().moveElement(i,0);

//more elseif conditions

}

}

but at the end the reordering of the elements didnot worked in the order i expected.Please provide your suggestions.

Thanks,

pkv.

Edited by: pkv on Oct 2, 2009 1:28 AM