Package com.pre.web.base

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

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

public class DivisionWindow extends Window {

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

  public void onCreate(){
    _init();
    createMenubar();
    refresh();
  }
 
  private void _init() {
    manager=(DivisionManager)WebApplication.lookup(DivisionManager.LocalJNDIName);
    Grid divisionsGrid=(Grid)getFellow("divisionsGrid");
    divisionsGrid.setRowRenderer(new DivisionRowRenderer());
    divisionsGrid.setModel(new ListModelList());
  }

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

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

}
TOP

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

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.