Requirement Constraints

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

Friday, 8 February 2013

ZK Passing Parameter between two files using MVVM–Part 1

Posted on 17:19 by Unknown

Overview

This is the first series of articles about Passing parameter between two zul files using MVVM Design pattern.This article will focus on the how to pass values from the parent window to child window opened in modal mode.
ZK Version : ZK 6.5.0 CE

So What we are going to do ?
1. Assume that you have small screen with a button to show another screen which opened as modal.
2. Now on Clicking of the Button, we will show the Second screen and also we will pass some arguments to the destination window.
Step 1:
If you are new ZK, then first set the development environment by following this document.

Step 2:

Let us create the Project in eclipse. Click File -> New -> ZK Project . Let us name the project as ZKMVVMPassingParameter1

Step 3:
Now let us create a zul file in the name of ParentWindow.zul. This zul is pretty simple contains two labels with textboxes and one button. So on clicking the button, we will call another zul file and also we will also pass the value of the text boxes typed by the user.
<?page title="Parent Window" contentType="text/html;charset=UTF-8"?>
<zk>
    <window title="Parent Window" border="normal"
        apply="org.zkoss.bind.BindComposer"
        viewModel="@id('myvm') @init('com.demo.ParentVM')">
        <label value="First Name"></label>
        <separator></separator>
        <textbox id="firstName" value="@bind(myvm.firstName)"></textbox>
        <separator></separator>
        <label value="Last Name"></label>
        <separator></separator>
        <textbox id="lastName" value="@bind(myvm.lastName)"></textbox>
        <separator></separator>
        <button label="Show Window" id="showWindow"
            onClick="@command('showChildWindow')">
        </button>
    </window>
</zk>
Step 4:
Now we will add our VM to our Parentwindow.zul as follows. Create a package called "org.com.demo" and create a java file called "ParentVM.java" Now on button click, we will call the ChildWindow.zul with the arguments as shown here.

package com.demo;
 
import java.util.HashMap;
 
import org.zkoss.bind.annotation.Command;
import org.zkoss.zk.ui.Executions;
 
public class ParentVM {
 
    private String firstName;
    private String lastName;
 
    public String getFirstName() {
        return firstName;
    }
 
    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }
 
    public String getLastName() {
        return lastName;
    }
 
    public void setLastName(String lastName) {
        this.lastName = lastName;
    }
 
    @Command
    public void showChildWindow() {
        final HashMap<String, Object> map = new HashMap<String, Object>();
        map.put("firstName", this.firstName);
        map.put("lastName", this.lastName);
        Executions.createComponents("ChildWindow.zul", null, map);
 
    }
}
Step 5:
Now let us create a zul file in the name of ChildWindow.zul. In this zul file also, we have two labels and two text boxes in which by default when this zul file is called we are going to receive the arguments and fill the values.

<?page title="Child Window" contentType="text/html;charset=UTF-8"?>
<zk>
    <window id="childwindow" title="Child Window" border="normal" mode="modal" width="20%">
        <label value="First Name"></label>
        <separator></separator>
        <textbox value="${arg.firstName}"></textbox>
        <separator></separator>
        <label value="Last Name"></label>
        <separator></separator>
        <textbox value="${arg.lastName}"></textbox>
        <separator></separator>
        <button label="Close" onClick="childwindow.detach()"></button>
    </window>
</zk>


Step 6:
That’s all. Now you can run ParentWindow.zul and type some value for first and last Name and click the button to show the values in the childwindow.zul
1. Type some values for the text boxes
2. Click the button, now you can see the values are populated.

Project Structure
image
 
You can download the source here.

Online Demo here.
Reference
1. http://books.zkoss.org/wiki/ZK_Developer's_Reference/MVVM
2. http://books.zkoss.org/wiki/ZK%20Developer's%20Reference/MVVM/Syntax/ViewModel/@Command
3. http://books.zkoss.org/wiki/ZUML_Reference/EL_Expressions/Implicit_Objects/arg

 







Read More
Posted in ZK Calling Another ZUL | No comments

Wednesday, 6 February 2013

ZK Passing Parameter between two files using MVC and MVVM

Posted on 09:36 by Unknown

In this post, we will see step by step tutorial on How to pass arguments between two zul files using MVC/MVVM Design Patter in different way.

MVC

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.

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.

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.

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.

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

Part 6, Finally one small application created using this link on this subject.


 

MVVM

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.

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.

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.

Part 4, In this post, we will see how we can pass parameter between two zul files attached by MVVM using URL Redirect

Using this link, I have created the same example in MVVM. you can download source here.

Read More
Posted in ZK Calling Another ZUL | No comments

How to submit the claims after primary insurance ?

Posted on 09:10 by Unknown

This is another interesting area where lot of automation is required in the software.

Once the primary insurance carrier pays their share of the claim it is then submitted to the secondary insurance company if the patient has one. Secondary claims can also be sent electronically and on paper. Medicare is mandating electronic submissions even on secondary claims. When submitted electronically all the information from the eob (explanation of benefits) is entered into the claim information and submitted to the secondary insurance carrier.

Now days, most of the insurance company accepts electronically if they are secondary payer. Here the term “Secondary payer” does not really mean the number 2. Any insurance after the primary is normally called as Secondary payer, but as per the patient, it may be in the third position. As per new 5010 documentation, it supports the submission of claims containing up to 11 payers (destination payer plus 10 non-destination payers).

Some times, the primary insurance itself forward the claim to secondary insurance and that information will be given in the EOB. This makes easy for the billing team.

I found a good article on how to send the claims to the secondary payer via Paper CMS 1500 FORM. I am just giving that information here.

When the secondary is submitted on paper, the claim is printed out again on a cms form and a photocopy of the eob is attached. If other patients are listed on the eob, their personal information should be hidden. Many offices use black markers to draw through the unwanted information. Secondary is submitted on paper to the insurance companies that are not yet accepting electronic submissions.

New billing staff should understand that the secondary insurance plan cannot process the claim without a copy of the primary carrier EOB.

If there is still a balance after the secondary insurance carrier pays their share, the claim is sent on to the third carrier. It is printed out again on a cms form and copies of the eobs of both the primary and the secondary insurance carriers are attached.

Whenever you send secondary and tertiary claims on paper, make sure the photocopies you attach are clear, easy to read, and for the correct date of service. Many insurance carriers scan the eobs which lightens them a little. If the copy you submitted was already light, by the time the claim is processed it may be sent back to you as unreadable. It takes a lot more time to find the original eob and resubmit a claim than it does to get it right the first time.

Secondary and tertiary claims can sometimes seem like a pain to get paid – especially because they can be for a very small amount of money. It is still important to file and track these claims to keep your receivables under control. It may not seem like a lot of money but it adds up. If you have a system for submitting them it really isn’t that bad

Read More
Posted in Billing Process | No comments

Tuesday, 5 February 2013

ZK Passing Parameter between two files using MVC - Part 5.

Posted on 09:50 by Unknown

Overview

This is the fifth series of articles about Passing parameter between two zul files using MVC Design pattern.This article will focus on the How to return values from the child window (Modal) to the Calling Parent Window using sendevent.

So What we are going to do ?
1. Assume that you have small screen with a button to show another screen which opened as modal.
2. Now on Clicking of the Button, we will show the Second screen and also we will pass some arguments to the destination window.
3. And also, after closing the second screen, we will return values typed by the user to calling window and update the textboxes.

In the first article, we just displayed the passed arguments in zul file which do not have any controller.
In the second article, we have seen how we can receive the parameters in the controller and show the them in the ZUL.
In the third article, we have seen how we can show the values in the UI using ZK annotate data binder.
In the fourth article, we have seen how we can return values from the child window to parent window using ZK Event queues concept.

This article is same like of fourth article, but we will use different way to return the parameters from the child window to parent window.
We can achieve the same result using sendEvent method in zk.

Step 1:
If you are new ZK, then first set the development environment by following this document.

Step 2:

Let us create the Project in eclipse. Click File -> New -> ZK Project . Let us name the project as ZKMVCPassingParameter5

Step 3:
Now let us create a zul file in the name of ParentWindow.zul. This zul is pretty simple contains two labels with textboxes and one button. So on clicking the button, we will call another zul file and also we will also pass the value of the text boxes typed by the user.
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="parentWindow" ?>
<?page title="Parent Window" contentType="text/html;charset=UTF-8"?>
<zk>
    <window id="parentWindow" title="Parent Window" border="normal"
        apply="org.com.demo.ParentWindowController">
        <label value="First Name"></label>
        <separator></separator>
        <textbox id="firstName"
            value="@{parentWindow$ParentWindowController.firstName}">
        </textbox>
        <separator></separator>
        <label value="Last Name"></label>
        <separator></separator>
        <textbox id="lastName"
            value="@{parentWindow$ParentWindowController.lastName}">
        </textbox>
        <separator></separator>
        <button label="Show Window" id="showWindow"></button>
    </window>
</zk>

Step 4:
Now we will add our controller to our Parentwindow.zul as follows. Create a package called "org.com.demo" and create a java file called "ParentWindowController.java" Now on button click, we will call the ChildWindow.zul with the arguments as shown here.


package org.com.demo;
 
import java.util.HashMap;
 
import org.zkoss.zk.ui.Execution;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.event.Event;
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.zkplus.databind.AnnotateDataBinder;
import org.zkoss.zul.Messagebox;
import org.zkoss.zul.Window;
 
@SuppressWarnings("serial")
public class ParentWindowController extends SelectorComposer<Window> {
 
    @Wire
    private Window parentWindow;
    
    private AnnotateDataBinder binder;
    private String firstName;
    private String lastName;
 
    public String getFirstName() {
        return firstName;
    }
 
    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }
 
    public String getLastName() {
        return lastName;
    }
 
    public void setLastName(String lastName) {
        this.lastName = lastName;
    }
 
    @SuppressWarnings({ "rawtypes", "unchecked" })
    public void doAfterCompose(Window comp) throws Exception {
        super.doAfterCompose(comp); // wire variables and event listners
        binder = new AnnotateDataBinder(comp);
 
    }
 
    @Listen("onClick=#showWindow")
    public void showChild() {
        final HashMap<String, Object> map = new HashMap<String, Object>();
        map.put("firstName", this.firstName);
        map.put("lastName", this.lastName);
        map.put("parentWindow", parentWindow);
        Executions.createComponents("ChildWindow.zul", null, map);
 
    }
 
    /**
     * This method is actualy an event handler triggered only from the Child
     * window dialog and it is responsible to reflect the data changes
     * 
     */
    @Listen("onSaved = #parentWindow")
    public void onSaved(Event event) {
        final HashMap<String, Object> map = (HashMap<String, Object>) event.getData();
        setFirstName((String) map.get("firstName"));
        setLastName((String) map.get("lastName"));
        binder.loadAll();
    }
 
}
Step 5:
Now let us create a zul file in the name of ChildWindow.zul. In this zul file also, we have two labels and two text boxes in which by default when this zul file is called we are going to receive the arguments and fill the values.


<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="childwindow" ?>
<?page title="Child Window" contentType="text/html;charset=UTF-8"?>
<zk>
    <window id="childwindow" title="Child Window" border="normal"
        mode="modal" width="30%" apply="org.com.demo.ChildWindowController">
        <label value="Change the first name and Last name and click the button close to return the values"></label>
        <separator></separator>
        <label value="First Name"></label>
        <separator></separator>
        <textbox id="firstName" value="@{childwindow$ChildWindowController.firstName}"></textbox>
        <separator></separator>
        <label value="Last Name"></label>
        <separator></separator>
        <textbox id="lastName"
            value="@{childwindow$ChildWindowController.lastName}">
        </textbox>
        <separator></separator>
        <separator></separator>
        <button id="btn" label="Close"></button>
    </window>
</zk>
Step 6:
Now Let receive the parameter in the ChildWindow controller class. In the package “org.com.demo" and create a java file called "ChildWindowController.java"


package org.com.demo;
 
import java.util.HashMap;
 
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Execution;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventQueue;
import org.zkoss.zk.ui.event.EventQueues;
import org.zkoss.zk.ui.event.Events;
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.Messagebox;
import org.zkoss.zul.Textbox;
import org.zkoss.zul.Window;
 
@SuppressWarnings("serial")
public class ChildWindowController extends SelectorComposer<Window>{
 
    @Wire
    Button btn;
    
    @Wire
    Window childwindow;
    
    private Window parentWindow;
    
    private String firstName;
    private String lastName;
 
    public String getFirstName() {
        return firstName;
    }
 
    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }
 
    public String getLastName() {
        return lastName;
    }
 
    public void setLastName(String lastName) {
        this.lastName = lastName;
    }
 
    public void doAfterCompose(Window comp) throws Exception {
        super.doAfterCompose(comp);
         
        final Execution execution = Executions.getCurrent();
        setFirstName((String) execution.getArg().get("firstName"));
        setLastName((String) execution.getArg().get("lastName"));
        parentWindow = (Window) execution.getArg().get("parentWindow");
         
 
    }
 
    @Listen("onClick = button#btn")
    public void changeLabel() {
        
        final HashMap<String, Object> map = new HashMap<String, Object>();
        map.put("firstName", this.firstName);
        map.put("lastName", this.lastName);
        
        childwindow.detach();
        Events.sendEvent(new Event("onSaved", parentWindow,map));
    }
 
    public String returnSomething()
    {
        return "senthil";
    }
}



Step 7:
That’s all. Now you can run ParentWindow.zul and type some value for first and last Name and click the button to show the values in the childwindow.zul
1. Type some values for the text boxes
2. Click the button, now you can see the values are populated.
3. Change the values again in the Modal window and click the close button.
4. Now you can see that changed values are replaced in the parent window text boxes.
Project Structure

image_thumb3
You can download the source here.
Reference
1. http://books.zkoss.org/wiki/ZK_Developer's_Reference/Event_Handling/Event_Firing
2. http://books.zkoss.org/wiki/ZK_Developer's_Reference/MVC
3. http://books.zkoss.org/wiki/ZK_Developer's_Reference/MVC/Controller/Composer
4. http://books.zkoss.org/wiki/ZK_Developer's_Reference/MVC/Controller/Wire_Variables
5. http://www.zkoss.org/zkdemo/getting_started/mvc
6. http://books.zkoss.org/wiki/ZUML_Reference/EL_Expressions/Implicit_Objects/arg
7. http://books.zkoss.org/wiki/ZK_Component_Reference/Essential_Components/Include
8. http://books.zkoss.org/wiki/ZK%20Developer's%20Reference/MVC/Controller/Composer
9. http://books.zkoss.org/wiki/ZK%20Developer's%20Reference/UI%20Composing/ZUML/EL%20Expressions
10. http://books.zkoss.org/wiki/Small_Talks/2008/August/ZK_MVC_Made_Easy
11. http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zkplus/databind/AnnotateDataBinder.html
12. http://books.zkoss.org/wiki/Small_Talks/2010/July/Improved_AnnotateDataBinder_Initializer
13. http://books.zkoss.org/wiki/ZK_Essentials/Displaying_Information_in_a_Grid_Using_Data_Binding/The_Concept_of_Data_Binding




Read More
Posted in ZK Calling Another ZUL | No comments
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Popular Posts

  • 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 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 Instructions
    HIPAA Compliant Codes All the Health care EDI Transaction set should use only the following HIPAA Compliant Codes Physicians Current Pro...
  • 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...
  • 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 ...
  • 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...
  • 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...
  • EDI Transactions
    The HIPAA transactions and code set standards are rules that standardize the electronic exchange of health-related administrative informati...
  • 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)
      • EDI Instructions
      • Understanding EDI Structure
      • What is an EDI ?
    • ►  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)
    • ►  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