Let me list the most common features in the Appointment module and their priority using MoSCoW Method.
X12 EDI Examples
EMR Appointment Features
EMR and PMS Links
New to Health care Domain? Here are some documents which can help you to understand the basics. I am trying to refer to the official link(where i downloaded the document) and as well as link to my server(some time, official links are broken).
Healthcare Introduction
All about Prescription
- An Introduction to ePrescription
- How ePrescribing works
- Paper Prescription workflow
- Electronic Prescription workflow
- Refill Paper Prescription workflow
- Refill Electronic Prescription workflow
Flow charts
- Medical Billing Overview
- Rooming Overview
- Medical Billing Flow chart
- EMR Test Visit Flow chart
- EMR Patient Examination Flow chart
- EMR Office visit Flow chart
- Medical Claim Life Cycle
- Claim Adjudication and Payment Flow chart
- EMR Office Visit
- Billing Flow chart
EMR
Good Website Design Links
- Label Placement in Forms
- International Address Fields in Web Forms
- 40 Eye-Catching Registration Pages
- blog-comment-form-designs-good-examples
- Wufoo Form Gallery
Left Navigation Bar
Search Form
- http://webdesignerwall.com/tutorials/beautiful-css3-search-form
- http://www.awcore.com/html/news/8/6-awesome-css-search-box_en#!prettyPhoto
- http://www.bloggermint.com/demos/css3searchbox/
- http://webdesignerwall.com/tutorials/css3-gradient-buttons
- Fast Rollovers Without Preload
- CSS3 BUTTONS
CRUD operations
- Contrasting Foreground and Background Colors
- Background and Foreground Colors Test Page
- Background and Foreground combinations
- http://www.crockford.com/wrrrld/color.html
- http://www.colors.commutercreative.com/
- http://www.w3schools.com/cssref/css_colornames.asp
- http://www.colorcombos.com/
- http://www.99colors.net/color-names
Open Source Demo
- https://demo.bookstackapp.com/login
- http://demo-acm-2.bird.eu/admin/admin/index/index/key/
- http://ordermanager.demo.fooman.co.nz/index.php/admin/dashboard/index/key/b0f87c48cbfaaf6dc3ab9779ba665f23/
Theme
JQuery
Claims adjudication and payment
The Following picture demonstrates how insurance company processing the claims received from the clearing house.
How to install Maven in the Windows
Let us see how we can first setup Maven in the Windows step by step.
Some Important Master screens for PMS
Last year I was involved in developing an independent system for PMS using VB6 with sql server 2005. I really enjoyed myself and love to work/complete that project. One of my best period in my life. But unfortunately, we could not able to market the product because of VB6 no longer used widely in the industry.
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 and some of them of my own question and answer . And also I just want to have a reference about this, so that when I get chance to implement this, I can always come and refer here. At the end, I just summarized my thought on how we can implement in the EMR PMS Application.
EDI 5010 Documentation–837 - BHT - Beginning of Hierarchical Transaction
BHT – Beginning of Hierarchical Transaction
Hibernate Validator - Creating custom constraints @Required – Example 4
In this post, we will see how we can create our own custom constraints tailored to our specific requirements.
Hibernate Validator - Creating custom constraints–Example
In this post, we will see how we can create our own custom constraints tailored to our specific requirements.
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 message.
Hibernate Validator Examples
Here is the introduction notes from the hibernate documentation
In the first example, we will see very basic not null constraint validation. Here is the Step by Step Tutorial.
In the second example, we will see some more constraint validation. Here is the Step by Step Tutorial.
In this example, we will see how we can create our custom constraint validation. Here is the Step by Step Tutorial.
In this example, we will see how we can create our custom constraint @Required. Here is the Step by Step Tutorial.
In this example, nothing is new, we will take care example 2 and will use the utility class to perform validation. Here is the Step by Step Tutorial.
ZK Examples Index Page
ZK Projects
ZK 7 Project Start-up Kit – Theme with full source code and support |
ZK 8.5 Version Video Tutorials . All New created in July 2018
ZK Free Examples and Tutorials
ZK Maven | Create and Run Your First ZK 7 Application with Eclipse and Maven | |
ZK 7 | ZK 7 Simple Form Design(s) Part 1 | |
ZK 7 | ZK with External style sheet | |
ZK MVVM | MVVM – Introduction | |
ZK MVVM | MVVM Examples–Example 1 | |
ZK MVVM | MVVM Examples–Example 2 | |
ZK 7 | ZK MVVM Simple List Box Example | |
ZK 7 | How to show particular row in ZK Listbox with different color in MVVM | |
ZK 7 | ZK 7 MVVM List Box Select All and Unselect all Records | |
ZK 7 | ZK MVVM List box with check box – Simple Example | |
ZK List Box | Move List box item up and Down using MVVM Design Pattern | |
ZK List Box | List Item Double click event on selected Item using MVVM | |
ZK List Box | ZK List box inline Editing with Add New and Delete action | |
ZK List Box | ZK MVVM List box with Dynamic Template | |
ZK 7 Hibernate | ZK 7 + MySQL + Hibernate + Spring + Integration example | |
ZK 7 Excel | ZK 7 Export to Excel | |
ZK File Upload | Simple example to upload PDF file in the server and show the content using iframe - MVVM | |
ZK File Upload | ZK 7 upload PDF to server and show in the screen using MVVM–Part 2 | |
ZK Tab box | Load Tab box Content on Demand Using MVVM (Onselect Event) | |
ZK Grid | ZK Grid inline Editing with Add New and Delete action | |
ZK Upload | ZK Dropupload example | |
ZK Report | Create a Report with ZK using iReport 5.1.0 and JasperReports | |
ZK Menu | ZK Dynamic Menu Part 1 | Demo |
ZK Tree | ZK Dynamic Menu Part 2 Using Tree Component | Demo |
ZK Group Box | ZK Dynamic Menu Part 3 Using Group Box and Tool Bar Button | Demo |
ZK Tab Box | ZK Dynamic Menu Part 4 Using Tab box and Tool Bar Button | Demo |
ZK Menu | ZK Dynamic Menu Part 5 Using Tab Box, Tool Bar and Group Box | Demo |
ZK 7 Nav Bar | ZK Dynamic Menu Part 6 Using ZK 7 Navigation Bar | |
ZK Combo | MVC Two combo Box – Fill second combo based on first combo selection | |
ZK Combo | ZK MVVM Combo Box value Converter | |
ZK Validation | Simple Example for ZK Input Form Validation | |
ZK MVC | Listing Search using MVC Pattern | Demo |
ZK MVC Passing arguments | Part 1, This article will focus on the How to pass some arguments from one window(Parent) to modal window(Child) where child window does not have any controller attached. | Demo |
ZK MVC Passing arguments | Part 2, This article will focus on the How to pass some arguments from one window(Parent) to modal window(Child) where child window attached to the controller and we will receive the arguments in the controller and display back to UI. | Demo |
ZK MVC Passing arguments | Part 3, This article will focus on the How to pass some arguments from one window(Parent) to modal window(Child) where child window attached to the controller and we will receive the arguments in the controller and display back to UI. Same as Part 2, but we will use ZK ‘s annotated data binding manager utility. | Demo |
ZK MVC Passing arguments | Part 4, This article will focus on the How to return values from the child window (Modal) to the Calling Parent Window using ZK Event Queues concept. | Demo |
ZK MVC Passing arguments | Part 5, This article will focus on the How to return values from the child window (Modal) to the Calling Parent Window using ZK Send Event | Demo |
ZK MVC Passing arguments | Example on Passing arguments in MVC | Demo |
ZK MVVM Passing arguments | Part 1, This article will focus on the How to pass some arguments from one window(Parent) to modal window(Child) where child window does not have any VM attached. | Demo |
ZK MVVM Passing arguments | Part 2, This article will focus on the How to pass some arguments from one window(Parent) to modal window(Child) where child window attached with VM and arguments are received in the VM and update the UI. | Demo |
ZK MVVM Passing arguments | Part 3, This article will focus on the How to pass some arguments from one window(Parent) to modal window(Child) where child window attached with VM and arguments are received in the VM and update the UI. After child window is closed, we will return the value to the parent window. | Demo |
ZK MVVM Passing arguments | Part 4, In this post, we will see how we can pass parameter between two zul files attached by MVVM using URL Redirect | Demo |
ZK Login Form CSS | ZK Login form Design | |
ZK Login | ZK + Spring Security Login form–Part 1 | |
ZK Login | ZK + Spring Security Login form–Part 2 | |
ZK Login | ZK + Spring Security Login form–Part 3 | |
ZK Login | ZK + Spring Security Login form– Additional Login Parameters - Part 4 | |
ZK Login | ZK + Spring Security Login form–Part 5 |
ZK 7 CSS
ZK Window | ZK 7 Window CSS Example1 | |
ZK Group Box | ZK 7 Group Box Example 1 | |
ZK 7 | ZK 7 Message box CSS | |
ZK TextBox | Small Search Box |
ZK 6 CSS
ZK Small Application
ZK MVVM CRUD Example without DB Connection Step by step tutorial on ZK MVVM CRUD Operation without any DB Connection. online Demo here |
ZK MVVM With Spring + JPA + Hibernate Entity Manager |
ZK MVVM With Spring + Hibernate 4 API Direct |
ZK MVC CRUD With Spring 3 + JPA + Hibernate 4 Entity Manager. |
ZK + Spring Security Custom Login form. |
ZK + Spring + MVVM + Hibernate - Small Application Highlights |
ZK 7 + Spring + MVVM + Hibernate + MySQL + List Box Highlights |
MVVM Command annotation and Notify change example
Here is an example, how to pass parameter on a zul through MVVM Command binding annotation.
ZK Hibernate one to Many annotation mapping bidirectional CRUD example using MVVM
In this post, we will see how we can implement hibernate one to Many mapping (master & detail) bidirectional using ZK Components
One to many mapping using bidirectional relationship – onetoMany as Owner
First let us look the hibernate documentation on this as follows
EMR In-house Lab workflow
Back to domain
In my last company, we follow the below workflow for the in-house lab order. Please note : Even though I mention as use case, but it may not have all the typical structure of a use case. I will explain in my own way.
One to many mapping using bidirectional relationship– ManytoOne as owner
First let is look the hibernate documentation on this as follows
Hibernate–Java Environment setup
We will see how we can setup the Environment in eclipse to learn our examples in hibernate.
My date box Component
Using jquery plugin, we will create our date box component in ZK and apply mask and water mark. You can download the jquery plugin from the following site
http://digitalbush.com/projects/masked-input-plugin/
http://digitalbush.com/projects/watermark-input-plugin/
Tech Links
Hibernate
Spring Security
- Spring Security Part 1 – Simple Login application with database
- quick-spring-security tutorial in eclipse step by step
Spring + Hibernate + JPA + Entity Manager
- Integrate with spring and JPA and ZK
- JPA basic example with EntityManager , Spring and Maven
- Step by step configuration of Spring , Hibernate and JPA
- http://www.springbyexample.org/examples/one-to-many-jpa-hibernate-config-reference.html
Spring Service and DAO Layer
- Developing A Simple Java Application With Spring using Service and DAO Layers
- http://www.mkyong.com/spring/maven-spring-hibernate-annotation-mysql-example/
- http://vrtoonjava.wordpress.com/2012/06/17/part-3-dao-and-service-layer/
- http://www.techferry.com/articles/spring-annotations.html
HibernateTemplate or EntityManager
- http://forum.springsource.org/showthread.php?73629-EntityManager-versus-getHibernateTemplate()
- http://blog.michaelscepaniak.com/differences-between-hibernate-and-jpa
- http://blog.springsource.com/2007/06/26/so-should-you-still-use-springs-hibernatetemplate-andor-jpatemplate/
- http://www.coderanch.com/t/442507/oa/EntityManager-getHibernateTemplate
- http://stackoverflow.com/questions/12555055/jpas-entitymanager-or-hibernates-hibernatetemplate-with-spring
- http://www.baeldung.com/2011/12/13/the-persistence-layer-with-spring-3-1-and-jpa/
Generic DAO
- http://www.bejug.org/confluenceBeJUG/display/BeJUG/Generic+DAO+example
- http://hop2croft.wordpress.com/2011/06/23/dont-repeat-the-dao-no-repitas-el-dao/
- http://www.codeproject.com/Articles/251166/The-Generic-DAO-pattern-in-Java-with-Spring-3-and
- http://www.ibm.com/developerworks/java/library/j-genericdao/index.html
Spring and Hibernate ORM Framework Integration.
1. http://www.javabeat.net/2007/10/integrating-spring-framework-with-hibernate-orm-framework/
2. http://static.springsource.org/spring/docs/2.5.x/reference/orm.html
3. http://blog.springsource.org/2012/04/06/migrating-to-spring-3-1-and-hibernate-4-1/
4. http://javaprogrammingtips4u.blogspot.in/2010/04/spring-integration-with-hibernate_23.html
ZK Hibernate one to one annotation mapping bidirectional CRUD example using MVVM
In this post, we will see how we can implement hibernate one to one mapping bidirectional using ZK Components
ZK Component extend
In this post, we will see how we can create our component by extending ZK Component. All the jquery plugin can be used in ZK. The following example will explain how to create Phonebox, Zip Code and Tax ID.
ZK Messagebox Styling
This examples show how you can use change the Look and Feel of ZK MessageBox Component.
Combo Box– Show images for Items based on some condition
We will see how we can also show the images for the combo items bases on some conditions.
ZK Border Layout–Another example
This examples show how you can use ZK Border Layout to show the product information on clicking image.
MVVM–List Item–Hibernate–MySQL–Part 3
Note: This is continuation of my previous article Part 2. Please click here to go to Part 2
In this Part 3, we will enhance our Listing and model window as follows
1. We will include one more column as last named as Actions. This action will contain image such as edit, activate and delete.
2. We will also give hyperlink for the first column. If the user clicks the first column, then we will show the information in the read-only and if the user clicks the edit image in the action column, then we will show the information in the read only and will allow the user to edit and save.
C Workbook
In the year 1999-2002, I was working as faculty in a computer center. During that period, I developed a small VB Application to explain the concept of C. Here are the some screenshots from that VB Project
MVVM Modal window–Pass Parameter and Return values
In this post, we will see how we can pass some values to the modal window when calling from the parent window and also vice versa (i.e) return some values from the modal window to parent window
Project Name : MVVMModalWindow
Project Structure:
Demo.zul
<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<window title="MVVM Modal window Passing arguments and retur values"
border="normal" apply="org.zkoss.bind.BindComposer"
viewModel="@id('e') @init('com.demo.UI.demoVM')">
Type any value and Press the Model Window Button
<separator />
Value 1 :
<textbox value="@bind(e.value1)" />
Value 2 :
<textbox value="@bind(e.value2)" />
<button label="Model Window" onClick="@command('showModelWin')" />
</window>
</zk>
package com.demo.UI;
import java.util.HashMap;
import org.zkoss.bind.annotation.BindingParam;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.GlobalCommand;
import org.zkoss.zk.ui.Executions;
import org.zkoss.bind.annotation.NotifyChange;
public class demoVM {
private String value1;
private String value2;
public String getValue1() {
return value1;
}
public void setValue1(String value1) {
this.value1 = value1;
}
public String getValue2() {
return value2;
}
public void setValue2(String value2) {
this.value2 = value2;
}
@Command
public void showModelWin()
{
final HashMap<String, Object> map = new HashMap<String, Object>();
map.put("value1", this.value1 );
map.put("value2", this.value2);
Executions.createComponents("ModelWindow.zul", null, map);
}
@GlobalCommand
@NotifyChange({"value1","value2"})
public void refreshvalues(@BindingParam("returnvalue1") String str1, @BindingParam("returnvalue2") String str2)
{
this.value1 = str1;
this.value2 = str2;
}
}
<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<window id="modalDialog"
title="MVVM Modal window Passing arguments and retur values"
width="420px" height="auto" border="normal" minimizable="false"
mode="modal" maximizable="false" closable="true"
action="hide: slideUp" apply="org.zkoss.bind.BindComposer"
onCancel="@command('closeThis')"
viewModel="@id('e') @init('com.demo.UI.ModelWindowVM')">
Change the values and Press the Ok Button to return changed
values.
<separator />
Value 1 :
<textbox value="@bind(e.value1)" />
Value 2 :
<textbox value="@bind(e.value2)" />
<button label="Ok" onClick="@command('save')" />
</window>
</zk>
package com.demo.UI;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.ContextParam;
import org.zkoss.bind.annotation.ContextType;
import org.zkoss.bind.annotation.ExecutionArgParam;
import org.zkoss.bind.annotation.Init;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.select.Selectors;
import org.zkoss.zk.ui.select.annotation.Wire;
import org.zkoss.zul.Window;
import java.util.HashMap;
import org.zkoss.bind.BindUtils;
import java.util.Map;
public class ModelWindowVM {
@Wire("#modalDialog")
private Window win;
private String value1;
private String value2;
public String getValue1() {
return value1;
}
public void setValue1(String value1) {
this.value1 = value1;
}
public String getValue2() {
return value2;
}
public void setValue2(String value2) {
this.value2 = value2;
}
@Init
public void init(@ContextParam(ContextType.VIEW) Component view,
@ExecutionArgParam("value1") String v1,
@ExecutionArgParam("value2") String v2) {
Selectors.wireComponents(view, this, false);
this.value1 = v1;
this.value2 = v2;
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@Command
public void save() {
Map args = new HashMap();
args.put("returnvalue1", this.value1);
args.put("returnvalue2", this.value2);
BindUtils.postGlobalCommand(null, null, "refreshvalues", args);
win.detach();
}
@Command
public void closeThis() {
win.detach();
}
}
Now you can run the demo.zul file
C++ Workbook
ZK Border Layout–Menu on the left and content on the right.
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.
Many 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
MVVM–List Item–Hibernate–MySQL–Part 2
In this post, we will see how we can do the following stuffs
1. Add new person by calling a model window in MVVM and update in the DB
2. On Double click of the records in the list item, edit the existing record by calling a modal window in MVVM and update in the DB
3. Then after edit and add, we will refresh the list. Note, after edit, we no need to do anything, because data binding will take care. But after adding new person, we will refresh the list using Global command
Many thanks to potix Jimmy who helped me to complete this part 2. http://www.zkoss.org/forum/listComment/19829-ZK-MVVM-Modal-Window
Practice management System– PMS–Billing
Last year I was involved in developing an independent system for PMS using VB6 with sql server 2005. I really enjoyed myself and love to work/complete that project. One of my best period in my life. But unfortunately, we could not able to market the product because of VB6 no longer used widely in the industry.
Here are some of the screens which I like most in my development of VB6
Phone Box–Using j Query and Extending ZK Textbox
Summary
In this post, we will see how we can use jquery with ZK for US Phone number format. And also later on, we will see how we can this as a reusable component by extending the ZK Textbox
Thanks to the following ZK Forum and all the contributors who helped me to create this article
http://www.zkoss.org/forum/listComment/17490-How-to-apply-a-mask-in-a-Textbox-not-rendered-by-a-zul-file
MVC Two combo Box – Fill second combo based on first combo selection
We will see how to fill the second combo box based on first combo box selection using MVC Data binding.
MVVM Two combo Box – Fill second combo based on first combo selection
We will see how to fill the second combo box based on first combo box selection using MVVM Data binding.
MVVM–List Item–Hibernate–MySQL–Part 1
In every application, we will always have the listing page where we can list the records from the DB, from there another model window will be used to Add/Edit records.
In this post, we will see how we can do the following stuffs
1. Bind the List Item Using New zk 6 Data binding with MVVM Pattern
2. Retrieve the values from the DB – Mysql using Hibernate as ORM Tool.
3. How to change the color of the particular row based on some condition.
4. How to handle double click event on the List item.
5. How to sort the values in the List Item.
MVC Combo Box Data binding
List Item Double click event on selected Item using MVVM
MVVM Example for Form Validation
List Item on Select, show more details by using selectedItem
List item Change background color for some particular items based on some conditions
List Item Double click event on selected Item
ViewModel Class Java Annotation @Init, @NotifyChange, @Command
In following sections we'll list all syntaxes that can be used in implementing a ViewModel and applying ZK bind annotation.
ZK MVVM CRUD - Part 3
Previous Part 2
In Part 2, we slightly change the retrieve of objects by adding constructor. Now we will move forward. Let us take a look on the output as follows
Apart from the listing the records, we also have two search parameters such as Practice name and Show only active or inactive practices. So what we are going to do with this ? Well, if the list is big, then user has to move to particular page to locate the desired practice, instead of that we will filter the practice as soon as user starts typing the first few characters of the practice name. And also, by default we will show all the active (soft delete) records. If the user want to see all the records including deactivated, then on click of check box, we will also do that.
So here are the conditions
Case 1:
If no character present in the Practice name filter text area and also Show only active is unchecked, then let us show all the records from the DB.
Case 2:
If some characters are typed in the practice name filter and check box is unchecked, then show all active and inactive records for the practice whose first characters are matched with the filter text
Case 3:
If no character in practice name filter text area and check box is checked, then we will show all the active practices only.
Case 4:
If both the search parameters contains values, then we will retrieve the records accordingly.
And also, we are going to Apply new ZK Bind Annotation such as @NotifyChange and @Command. Please refer here for examples in this subject.
And also very important, we are not going hit the database for each character is typed or check box is checked or unchecked. First time we will hit the DB to bring the records and then we will do all the filter locally.
Step 1:
From the View, we need to pass the value of Practice name text area and Check box state (checked or unchecked) to the View Model to filter the record. So we will write the following getter and setter method.
private String practiceStartWith;
private boolean showOnlyActive;
public String getPracticeStartWith() {
return practiceStartWith;
}
public void setPracticeStartWith(String practiceStartWith) {
this.practiceStartWith = practiceStartWith;
}
public boolean isShowOnlyActive() {
return showOnlyActive;
}
public void setShowOnlyActive(boolean showOnlyActive) {
this.showOnlyActive = showOnlyActive;
}
Step 2:
Here is the modified PracticeVM.Javapackage UIVMs; import domain.Practice; import java.util.ArrayList; import java.util.List; import org.zkoss.bind.annotation.Command; import org.zkoss.bind.annotation.NotifyChange; import DomainDAO.practiceDAO; public class PracticeListVM { private List<Practice> AllPracticeInDB = null; private List<Practice> filteredPractices = null; private String practiceStartWith; private boolean showOnlyActive = true; public String getPracticeStartWith() { return practiceStartWith; } public void setPracticeStartWith(String practiceStartWith) { this.practiceStartWith = practiceStartWith; } public boolean isShowOnlyActive() { return showOnlyActive; } public void setShowOnlyActive(boolean pActive) { this.showOnlyActive = pActive; } public List<Practice> getprlist() { if (AllPracticeInDB == null) { filteredPractices = new ArrayList<Practice>(); AllPracticeInDB = new practiceDAO().getListingItems(); setShowOnlyActive(true); for (Practice item : AllPracticeInDB) { if (item.getIsActive() == 1) filteredPractices.add(item); } } return filteredPractices; } @NotifyChange("prlist") @Command public void doFilter() { filteredPractices.clear(); /* if no filter characters and check box is un checked. Then get all */ /* 0 and 0 */ if ((practiceStartWith == null || "".equals(practiceStartWith)) && (showOnlyActive == false)) { filteredPractices.addAll(AllPracticeInDB); } /* * if there are filter characters and check box is un checked. Then get * filtered by filter text */ /* 1 and 0 */ if ((practiceStartWith != null && !practiceStartWith.equals("")) && (showOnlyActive == false)) { for (Practice item : AllPracticeInDB) { if (item.getPracticeName().toLowerCase() .indexOf(practiceStartWith.toLowerCase()) == 0) filteredPractices.add(item); } } /* * if no filter characters and check box is checked. Then get only * active practices */ /* 0 and 1 */ if ((practiceStartWith == null || "".equals(practiceStartWith)) && (showOnlyActive == true)) { for (Practice item : AllPracticeInDB) { if (item.getIsActive() == 1) filteredPractices.add(item); } } /* * Both Contains values i.e filter contains some text and check box is * checked */ /* 1 and 1 */ if ((practiceStartWith != null && !practiceStartWith.equals("")) && (showOnlyActive == true)) { for (Practice item : AllPracticeInDB) { if (item.getPracticeName().toLowerCase() .indexOf(practiceStartWith.toLowerCase()) == 0) if (item.getIsActive() == 1) filteredPractices.add(item); } } } }
Step 3:
Here is the modified practiceList.zul
<?page title="Practice List" contentType="text/html;charset=UTF-8"?> <zk> <window apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('UIVMs.PracticeListVM')"> <div> <button label="Add Practice" /> </div> <separator /> <groupbox height="40px"> <label value="Practice Name" /> <space /> <space /> <textbox width="250px" value="@bind(vm.practiceStartWith)" onChange="@command('doFilter')" instant="true" /> <button id="gobutton" label="Go" /> <space spacing="20px" /> <checkbox id="activechk" label="Show only active" checked="@bind(vm.showOnlyActive)" onCheck="@command('doFilter')" /> <space spacing="20px" /> </groupbox> <separator /> <listbox id="PracticeList" model="@load(vm.prlist)"> <listhead sizable="true"> <listheader label="Practice Name" sort="auto" /> <listheader label="City" sort="auto" /> <listheader label="State" sort="auto" /> <listheader label="Zip Code" sort="auto" /> </listhead> <template name="model" var="p1"> <listitem> <listcell label="@load(p1.practiceName)" /> <listcell label="@load(p1.city)" /> <listcell label="@load(p1.state)" /> <listcell label="@load(p1.zipCode)" /> </listitem> </template> </listbox> </window> </zk>
Step 4:
Now we can run and play around both practice name filter and check box.
The following is the execution flow
1. An Instance will be created for our PracticeListVM
2. Since we declared true value initially for showonlyactive, and also we bind our checkbox with showactiveonly, so first set method of showonlyactive will take place.
3. Then our getprList will take place because we bind our list to this get method.