Requirement Constraints

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Monday, 18 June 2012

ZK Border Layout–Menu on the left and content on the right.

Posted on 10:45 by Unknown

In this post, let us see how we can load all our project menu in the left and on click of each of menu, then we will load individual zul file on the right side. Here, we are going to use border layout, where north border going to content menu and west border will be used to load the individual zul file.

Left hugMany thanks Stephan who helped me to complete this task. Here is the forum thread
http://www.zkoss.org/forum/listComment/18840-Menu-Links-on-Left-Side-and-Page-Content-on-Right-Side?lang=en

ZK Version : ZK 6

Project Name :BorderLayout

Project Structure;

image

Demo.zul

<zk>

<window border="none" width="100%" height="100%" id="main">
<separator />
<div left="20px" height="25px">
<image src="/images/zklogo_s.png"
style="padding-left: 10px;" height="30px" width="auto" />
</div>
<separator />
<borderlayout id="mainlayout">
<north border="normal" height="70px">
<div id="Menu" sclass="Mainmenudiv">
<include src="mainmenu.zul" />
</div>
</north>
<west title=" " size="20%" flex="true" splittable="true"
collapsible="true">
<div id="nav" style="background:white; height:100%">
<include src="navmenu.zul" />
</div>
</west>
<center border="normal">
<div height="99%" id="Screen"></div>
</center>
<south height="70px">
<div align="center">
<label
value="Copyright © 2012 xxxxxxxx All Rights Reserved. Powered By xxxxx"
sclass="loginlabel" />
</div>
</south>
</borderlayout>
</window>
</zk>


democomposer.java


package mydomain;

import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.MouseEvent;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.Path;
import org.zkoss.zk.ui.util.GenericForwardComposer;
import org.zkoss.zul.Borderlayout;
import org.zkoss.zul.Center;
import org.zkoss.zul.Messagebox;

public class democomposer extends GenericForwardComposer {

public void onClickMenu(MouseEvent event) {

String zulFilePathName;
Borderlayout bl = (Borderlayout) Path.getComponent("/main/mainlayout");
/* get an instance of the searched CENTER layout area */
Center center = bl.getCenter();

/* clear the center child comps */
center.getChildren().clear();

//Messagebox.show("inside" + event.getTarget().getId());
zulFilePathName = event.getTarget().getId() + ".zul";
/* create the page and put it in the center layout area */
Executions.createComponents(zulFilePathName, center, null);
}
}


zk.zul



<?page title="Main Menu" contentType="text/html;charset=UTF-8"?>
<zk>
<label value="ZK Contents goes here" style="color: #696569; font-size : 34px; font-weight: bold;" />
</zk>

 


blog.zul



<?page title="Main Menu" contentType="text/html;charset=UTF-8"?>
<zk>
<label value="ZK blog Contents goes here" style="color: #696569; font-size : 34px; font-weight: bold;" />
</zk>


Contributors.zul


<?page title="Main Menu" contentType="text/html;charset=UTF-8"?>
<zk>
<label value="ZK Contributors Contents goes here" style="color: #696569; font-size : 34px; font-weight: bold;" />
</zk>


forum.zul


<?page title="Main Menu" contentType="text/html;charset=UTF-8"?>
<zk>
<label value="ZK forum goes here" style="color: #696569; font-size : 34px; font-weight: bold;" />
</zk>


mainmenu.zul


<?page title="Main Menu" contentType="text/html;charset=UTF-8"?>
<zk>
<label value="Welcome to ZK" style="color: #696569; font-size : 34px; font-weight: bold;" />
</zk>


navmenu.zul


<?page title="Method3"?>

<zk>
<style>
.z-groupbox-3d-hm { background-image: none; background-color:
#0A246A !important; } .z-groupbox-3d-header .z-caption { color:
yellow; font-weight: bold;; } .z-groupbox-3d-cnt{
background-image: none; background-color: #EAECF0 !important; }

.open-true {float:right; background:url('img/UP201.png')
no-repeat right 0; height: 16px; padding-right: 20px;
font-weight: bold; }

.open-false {float:right; background:url('img/Down201.png')
no-repeat right 0; height: 16px; padding-right: 20px;
font-weight: bold; }

</style>
<window title="Administration" border="normal" width="270px" apply="mydomain.democomposer">
<groupbox width="250px" mold="3d">
<attribute name="onOpen"><![CDATA[
arrow1.setSclass("open-" + self.isOpen());
]]></attribute>
<caption label="Products">
<div id="arrow1" class="open-true"></div>
</caption>

<vbox>
<toolbarbutton id="ZK" label="ZK" forward="onClick=onClickMenu()"/>
<toolbarbutton id="ZkStudio" label="ZK Studio" forward="onClick=onClickMenu()"/>
<toolbarbutton id="ZkSpring" label="ZK Spring" forward="onClick=onClickMenu()"/>
<toolbarbutton id="ZKSpread" label="ZK SpreadSheet" forward="onClick=onClickMenu()"/>
</vbox>
</groupbox>
<groupbox width="250px" mold="3d">
<attribute name="onOpen"><![CDATA[
arrow2.setSclass("open-" + self.isOpen());
]]></attribute>
<caption label="ZK Demo">
<div id="arrow2" class="open-true"></div>
</caption>

<vbox>
<toolbarbutton id="ZKCalender"
label="ZK Calender" forward="onClick=onClickMenu()"/>
<toolbarbutton id="ZKWebmail" label="ZK Web Mail" forward="onClick=onClickMenu()"/>
<toolbarbutton id="ZKSandbox"
label="ZK Sand Box" forward="onClick=onClickMenu()"/>
<toolbarbutton id="ZKPiv" label="ZK Pivottable" forward="onClick=onClickMenu()"/>
</vbox>
</groupbox>
<groupbox width="250px" mold="3d">
<attribute name="onOpen"><![CDATA[
arrow.setSclass("open-" + self.isOpen());
]]></attribute>
<caption label="Community">
<div id="arrow" class="open-true"></div>
</caption>

<vbox>
<toolbarbutton id="forum"
label="forum" forward="onClick=onClickMenu()"/>
<toolbarbutton id="blog"
label="Blog" forward="onClick=onClickMenu()"/>
<toolbarbutton id="Contributors"
label="ZK Contributors" forward="onClick=onClickMenu()"/>
</vbox>
</groupbox>

</window>
</zk>


ZKCalender.zul


<?page title="Main Menu" contentType="text/html;charset=UTF-8"?>
<zk>
<label value="ZK calender contents goes here" style="color: #696569; font-size : 34px; font-weight: bold;" />
</zk>


ZKPiv.zul


<?page title="Main Menu" contentType="text/html;charset=UTF-8"?>
<zk>
<label value="ZK pivottable contents goes here" style="color: #696569; font-size : 34px; font-weight: bold;" />
</zk>


ZKSandbox.zul


<?page title="Main Menu" contentType="text/html;charset=UTF-8"?>
<zk>
<label value="ZK sandbox goes here" style="color: #696569; font-size : 34px; font-weight: bold;" />
</zk>


ZKSpread.zul


<?page title="Main Menu" contentType="text/html;charset=UTF-8"?>
<zk>
<label value="ZK spreadsheet content goes here" style="color: #696569; font-size : 34px; font-weight: bold;" />
</zk>


ZkSpring.zul


<?page title="Main Menu" contentType="text/html;charset=UTF-8"?>
<zk>
<label value="ZK spring content goes here" style="color: #696569; font-size : 34px; font-weight: bold;" />
</zk>


Now run the demo.zul and Click on the links on the left menu


image


Click here to see the demo


Download the source as war file

Email ThisBlogThis!Share to XShare to Facebook
Posted in ZK Layout | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • ZK Example for inline Editing with Add New and Delete
    I am quite impressed on this demo from ZK . But adding new record and delete existing record is missing as part of typical CRUD. So i thoug...
  • EDI 270–5010 Documentation - ISA – Interchange Control Header
    ISA – Interchange Control Header ISA – Interchange Control Header   The ISA is a fixed record length segment and all positions within ea...
  • Understanding EDI Structure
    EDI Structure Primary Levels are 1. Interchange Envelops 2. Functional Group 3. Transaction set Data Element A data element is equival...
  • ZK ListBox
    Let us first design a simple  static list box with crud Buttons as last column. Here is the code <?page title="Practice List" c...
  • EDI Instructions
    HIPAA Compliant Codes All the Health care EDI Transaction set should use only the following HIPAA Compliant Codes Physicians Current Pro...
  • List Item Connected with Hibernate and Search Parameter
      Summary This example contains one list box with First name and Last Name as search Field. If the user do not give any values for first n...
  • Physician Quality Reporting System - PQRS
    Let me just summarized the information which i understood clearly about PQRS . The following information are taken from different websites a...
  • EDI 270 - 5010 Health Care Eligibility/Benefit Inquiry
    If you are new to Medical Billing, then please read this article first . If you are new to EDI, then  read the following articles 1. What i...
  • Types of Reimbursement
    Fee-For-Service Fee-for-service is a method of payment where the provider is paid a fee for each procedure performed and billed.Most payer ...
  • Hibernate Validator Example 2
    In this example, we will see some more validation constraints such as @email, @past, @length, etc. And also we will also define custom error...

Categories

  • Billing Process
  • C Workbook
  • C++ Workbook
  • Eclipse Tips
  • EDI 5010
  • EMR Appointment Features
  • EMR Labs Stuff
  • EMR PMS Links
  • EMR Use cases
  • EMR Vital Sign
  • Good Website Design
  • Hibernate Criteria Queries
  • Hibernate Introduction
  • Hibernate Introduction Setup
  • Hibernate Mapping
  • Hibernate POC
  • Hibernate Validator
  • Hibernate–Java Environment setup
  • HPI
  • Java
  • Maven
  • MU Certification
  • NPI
  • PQRS
  • Practice Management System
  • Spring Security
  • Tech Links
  • Today Tech Stuff
  • zk
  • ZK Hibernate
  • ZK 5 Databinding
  • ZK Application
  • ZK Calling Another ZUL
  • ZK CheckBox
  • ZK CreateComponents
  • ZK CSS
  • ZK extended Components
  • ZK Foreach
  • ZK Forum Posts
  • ZK Framework
  • ZK Hibernate Setup
  • ZK ID Space
  • ZK Include
  • ZK Installation
  • ZK iReport
  • ZK Layout
  • ZK Listitem Pagination
  • ZK Message Box
  • ZK MVC
  • ZK MVC Combox Box
  • ZK MVC CRUD Examples
  • ZK MVC Listbox
  • ZK MVVM
  • ZK MVVM Combo
  • ZK MVVM CRUD
  • ZK MVVM ListBox
  • ZK Spring
  • ZK TextBox

Blog Archive

  • ►  2013 (105)
    • ►  December (3)
    • ►  September (7)
    • ►  August (13)
    • ►  July (1)
    • ►  June (11)
    • ►  May (3)
    • ►  April (14)
    • ►  March (19)
    • ►  February (21)
    • ►  January (13)
  • ▼  2012 (177)
    • ►  December (1)
    • ►  November (13)
    • ►  October (19)
    • ►  September (24)
    • ►  August (26)
    • ►  July (6)
    • ▼  June (37)
      • Combo Box– Show images for Items based on some con...
      • ZK Border Layout–Another example
      • MVVM–List Item–Hibernate–MySQL–Part 3
      • C Workbook
      • MVVM Modal window–Pass Parameter and Return values
      • C++ Workbook
      • ZK Border Layout–Menu on the left and content on t...
      • MVVM–List Item–Hibernate–MySQL–Part 2
      • Charge Entry Screen
      • Practice management System– PMS–Billing
      • Phone Box–Using j Query and Extending ZK Textbox
      • MVC Two combo Box – Fill second combo based on fir...
      • MVVM Two combo Box – Fill second combo based on fi...
      • MVVM–List Item–Hibernate–MySQL–Part 1
      • MVC Combo Box Data binding
      • MVVM Combo Box Data binding
      • List Item Double click event on selected Item usin...
      • MVVM Example for Form Validation
      • List Item on Select, show more details by using se...
      • List item Change background color for some particu...
      • List Item Double click event on selected Item
      • ViewModel Class Java Annotation @Init, @NotifyChan...
      • ZK MVVM CRUD - Part 3
      • ZK MVVM CRUD - Part 2
      • Select only few columns in Hibernate create query API
      • ZK MVVM CRUD - Part 1
      • Java List and ArrayList
      • Annotate non persistent properties with the @Trans...
      • MVVM Example 3–List item
      • Tab box with tool bar CSS
      • Change the location of the label in radio element
      • Hibernate 4.1.1 will create the column if we missp...
      • MVC–CRUD Application with ZK 5 Data Binding
      • Hibernate–Java Environment setup
      • How to refer CSS File in ZK Style tag
      • MVVM Examples–Example 2
      • MVVM Examples–Example 1
    • ►  May (30)
    • ►  April (16)
    • ►  March (1)
    • ►  January (4)
  • ►  2011 (5)
    • ►  December (1)
    • ►  November (1)
    • ►  July (1)
    • ►  June (1)
    • ►  April (1)
  • ►  2010 (1)
    • ►  September (1)
Powered by Blogger.

About Me

Unknown
View my complete profile