Skip to Content
0
Former Member
Sep 04, 2009 at 05:03 PM

Remove Element does not work

15 Views

Hi Experts,

I want to loop over a node and remove all elements in this node if they don't match a certain pattern (which needs to be checked by getting the details o these elements).

So looping over the node and checking whether the pattern matches works pretty fine (I've checked by using a counter variable which counts the number of matches and compares to the total size of the node). But removing the elements does not work.

I always get the complete table as the result but not without all those elements I that they'd be removed already. I also check the success status (boolean) of the remove function and it delivers always "true" so it seems to work.

This is the relevant coding:

	  for(int c = 0 ; c < wdContext.nodeMatnrlist().size() ; c++){
		wdContext.nodeMatnrlist().moveTo(c);		
		GetMaterialDetails(wdContext.currentMatnrlistElement().getMaterial());		
		
		if(!wdContext.currentMaterialDetailsElement().modelObject()
.getOutput().getMaterial_General_Data().getCreated_By().equals("BAIV-SS09-21")){
			success = wdContext.nodeMatnrlist().removeElement(wdContext.nodeMatnrlist().getCurrentElement());
			counter++;
		}
	  }

any Ideas on this?

Many thanks in advance!

Cheers

Tobias

Edited by: Tobias Fickinger on Sep 4, 2009 7:04 PM