Package com.pre.web.base

Source Code of com.pre.web.base.OrganizationWindow

package com.pre.web.base;

import org.zkoss.zul.Grid;
import org.zkoss.zul.ListModelList;
import org.zkoss.zul.Window;

import com.pre.session.base.OrganizationManager;
import com.pre.web.OptionBinder;
import com.pre.web.WebApplication;
import com.pre.web.base.renderers.OrganizationRowRenderer;

public class OrganizationWindow extends Window {


  /**
   *
   */
  private static final long serialVersionUID = -475711030922211406L;
  private OrganizationManager orgManager;

  public void onCreate(){
    _init();
    createMenubar();
    feedGrid();
  }
 
  private void _init() {

    orgManager=(OrganizationManager)WebApplication.lookup(OrganizationManager.LocalJNDIName);
    Grid organizationsGrid=(Grid)getFellow("organizationsGrid");
    organizationsGrid.setRowRenderer(new OrganizationRowRenderer());
    organizationsGrid.setModel(new ListModelList());
  }
 

  private void createMenubar() {
    OptionBinder.bindStandardOptions(this, "organizationsGrid", "details/OrganizationDetails.zul");
   
   
  }

  private void feedGrid() {
    Grid organizationsGrid=(Grid)getFellow("organizationsGrid");
    ListModelList model=(ListModelList)organizationsGrid.getModel();
    model.clear();
    model.addAll(orgManager.findAll());
  }
 
 
 
  private void refresh(){

    feedGrid();


  }

  public void onRefresh(){

    refresh();
  }


}
TOP

Related Classes of com.pre.web.base.OrganizationWindow

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.