Z order in runtime

Hi

Some reason this script does not seems to be working in “runtime”.

cont = system.gui.getWindow(‘Left’).getRootContainer()

comp = cont.getComponent(“Rectangle”)
comp1 = cont.getComponent(“Rectangle 1”)

cont.setComponentZOrder(comp,0)
cont.setComponentZOrder(comp1,1)

It works only in designer and there also so that I have to toggle design/runtime mode between actions?
Do I need some kind of refresh action??