/* FlexCtrl.java {{IS_NOTE Purpose: Description: History: Jan 18, 2013 6:46:16 PM , Created by Sam }}IS_NOTE Copyright (C) 2013 Potix Corporation. All Rights Reserved. {{IS_RIGHT }}IS_RIGHT */ package test; import java.util.ArrayList; import org.zkoss.zk.ui.HtmlNativeComponent; import org.zkoss.zk.ui.select.SelectorComposer; import org.zkoss.zk.ui.select.annotation.Listen; import org.zkoss.zk.ui.select.annotation.Wire; import org.zkoss.zul.Button; import org.zkoss.zul.Div; import org.zkoss.zul.Window; /** * @author Sam * */ public class FlexCtrl extends SelectorComposer { @Wire private Div cave; @Wire private Button btn; @Listen("onClick=#btn") public void doCreateWidget() { Window win = new Window(); win.setTitle("window"); win.setVflex("min"); win.setBorder(true); win.setWidgetOverride("unbind_", "function () { zk.log('unbind_ window'); this.$unbind_(); }"); if (cave.getChildren().size() == 0) { HtmlNativeComponent chd = new HtmlNativeComponent(); chd.appendChild(win); chd.setPrologContent("
"); chd.setEpilogContent("
"); chd.setParent(cave); btn.setLabel("invalidate widgets"); } else { cave.invalidate(); } } }