-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
I'm quite new to zk, so I probably overlook something.
I've created a composite component that implements AfterCompose
This source throws a "java.util.ConcurrentModificationException" at the point where I try to insertBefore.
oklbl is autowired.
public class MD extends Window implements AfterCompose { private Label oklbl; @Override public void afterCompose() { Executions.createComponents("/composites/MasterDetail.zul", this, null); Components.wireVariables(this, this); // auto wire variables Components.addForwards(this, this); // auto forward for(Component c: (List<Component>)this.getChildren()) if(c instanceof Button) { this.insertBefore(oklbl, c) } } }
How can I insert a control before another in afterCompose?
jaan
I think this is basic java ConcurrentModificationException when modify a List in it's element iteration.
I don't know what you are doing, however, regard to your code, you can try this
Button t = null; for(Component c: (List<Component>)this.getChildren()){ if(c instanceof Button) { t = (Button)c; break; } } if(t!=null){ this.insertBefore(oklbl, t) }
Asked: 2011-10-18 23:57:14 +0800
Seen: 481 times
Last updated: Oct 19 '11