Package com.pre.web.base

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

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.CompanyManager;
import com.pre.web.OptionBinder;
import com.pre.web.WebApplication;
import com.pre.web.base.renderers.CompanyRowRenderer;

public class CompanyWindow extends Window{

  /**
   *
   */
  private static final long serialVersionUID = -3879661220933336001L;
  private CompanyManager manager;

  private void _init() {

    manager=(CompanyManager)WebApplication.lookup(CompanyManager.LocalJNDIName);
    Grid companiesGrid=(Grid)getFellow("companiesGrid");
    companiesGrid.setRowRenderer(new CompanyRowRenderer());
    companiesGrid.setModel(new ListModelList());
  }

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

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

  private void feedGrid() {
    Grid companiesGrid=(Grid)getFellow("companiesGrid");
    ListModelList model=(ListModelList)companiesGrid.getModel();
    model.clear();
    model.addAll(manager.findAll());
  }

  private void refresh(){

    feedGrid();


  }

  public void onRefresh(){

    refresh();
  }







}
TOP

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

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.