The onOpen event is sent to the application if the user opens the popup window. By use of the fulfill attribute with the onOpen value as shown below, you can defer the creation of the popup window.
<bandbox fulfill="onOpen"> <bandpopup> ... </bandpopup> </bandbox>
Alternatively, you could prepare the popup window in Java by listening to the onOpen event, as depicted below.
<bandbox id="band" onOpen="prepare()"/> <zscript> void prepare() { if (event.isOpen() && band.getPopup() == null) { ...//create child elements } } </zscript>