|
Processing...
Description & Source Code
demo.zul
<zk> <style src="/widgets/getting_started/layout/style.css" /> <borderlayout vflex="min" apply="demo.getting_started.layout.LayoutController"> <north sclass="header" height="50px"> <label sclass="header-text">Search Car</label> </north> <west title="By Type" collapsible="true" width="160px" vflex="1"> <vlayout sclass="fn-panel1" hflex="1" vflex="1"> <label sclass="fn-title">Normal Class:</label> <hlayout sclass="fn-subpanel"> <vlayout width="60px"> <a label="MPV" sclass="fn-type" /> <a label="SUV" sclass="fn-type" /> <a label="Sedan" sclass="fn-type" /> </vlayout> <vlayout> <a label="Sport" sclass="fn-type" /> <a label="Supercar" sclass="fn-type" /> <a label="Van" sclass="fn-type" /> </vlayout> </hlayout> <label sclass="fn-title">Luxurious Class:</label> <hlayout sclass="fn-subpanel"> <vlayout width="60px"> <a label="MPV" sclass="fn-type" /> <a label="SUV" sclass="fn-type" /> <a label="Sedan" sclass="fn-type" /> </vlayout> <vlayout> <a label="Sport" sclass="fn-type" /> <a label="Supercar" sclass="fn-type" /> <a label="Van" sclass="fn-type" /> </vlayout> </hlayout> </vlayout> </west> <center sclass="nested-center" vflex="min"> <borderlayout vflex="min"> <west title="By Filter" collapsible="true" splittable="true" width="200px" minsize="200" vflex="min"> <vlayout sclass="fn-panel2" hflex="1"> <tablelayout columns="2" width="100%"> <tablechildren colspan="2"> <label sclass="fn-title">Accessories:</label> </tablechildren> <tablechildren> <checkbox label="ABS" sclass="fn-condi" /> </tablechildren> <tablechildren> <checkbox label="Airbag" sclass="fn-condi" /> </tablechildren> <tablechildren> <checkbox label="GPS" sclass="fn-condi" /> </tablechildren> <tablechildren> <checkbox label="Keyless" sclass="fn-condi" /> </tablechildren> <tablechildren> <checkbox label="Bumper" sclass="fn-condi" /> </tablechildren> <tablechildren> <checkbox label="Bike Rack" sclass="fn-condi" /> </tablechildren> <tablechildren colspan="2"> <label sclass="fn-title">Countries:</label> </tablechildren> <tablechildren> <checkbox label="America" sclass="fn-condi" /> </tablechildren> <tablechildren> <checkbox label="Britain" sclass="fn-condi" /> </tablechildren> <tablechildren> <checkbox label="China" sclass="fn-condi" /> </tablechildren> <tablechildren> <checkbox label="France" sclass="fn-condi" /> </tablechildren> <tablechildren> <checkbox label="Germany" sclass="fn-condi" /> </tablechildren> <tablechildren> <checkbox label="Italy" sclass="fn-condi" /> </tablechildren> </tablelayout> <space height="10px" /> <button label="Search" /> </vlayout> </west> <center> <tabbox height="100%"> <tabs> <tab label="Search Result 1" closable="false" /> <tab label="Search Result 2" closable="true" /> </tabs> <tabpanels> <tabpanel> <hlayout style="display: flex;justify-content: center;align-items:center" hflex="1" vflex="1"> <image src="/widgets/getting_started/img/car1.png" /> </hlayout> </tabpanel> <tabpanel> <hlayout style="display: flex;justify-content: center;align-items:center" vflex="1"> <image src="/widgets/getting_started/img/car2.png" /> </hlayout> </tabpanel> </tabpanels> </tabbox> </center> </borderlayout> </center> <south sclass="footer" height="50px"> <vlayout width="100%" sclass="footer-box" style="display: flex; align-items: center;flex-direction: column;"> <label sclass="footer_text">Copyright © 2005-2014</label> <label sclass="footer_text">Potix Corporation All rights reserved.</label> </vlayout> </south> </borderlayout> </zk> LayoutController.java
package demo.getting_started.layout; import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.event.MouseEvent; import org.zkoss.zk.ui.select.SelectorComposer; import org.zkoss.zk.ui.select.annotation.Listen; import org.zkoss.zk.ui.util.Clients; import org.zkoss.zul.impl.LabelElement; public class LayoutController extends SelectorComposer<Component> { private static final long serialVersionUID = 1L; @Listen("onClick = a, button") public void cannedResponse(MouseEvent event){ showNotify("Clicked "+((LabelElement)event.getTarget()).getLabel()); } private void showNotify(String msg){ Clients.showNotification(msg,"info",null,null,1000); } }
Copyright © 2005-2024 Potix Corporation All rights reserved.
|
Processing... |