package info.bukova.isspst.ui.reqsubjects;

import info.bukova.isspst.data.MUnitEmb;
import info.bukova.isspst.data.Material;
import info.bukova.isspst.filters.MaterialFilter;
import info.bukova.isspst.services.munits.MUnitService;
import info.bukova.isspst.services.reqsubjects.MaterialService;
import info.bukova.isspst.ui.ListViewModel;

import java.util.List;

import org.zkoss.bind.annotation.Init;
import org.zkoss.zk.ui.select.annotation.WireVariable;

public class MaterialList extends ListViewModel<Material> {
	
	@WireVariable
	private MaterialService materialService;
	
	@WireVariable
	private MUnitService munitService;

	private List<MUnitEmb> munitList;

	@Init
	public void init() {
		service = materialService;
		dataClass = Material.class;
		formZul = "materialForm.zul";
		dataFilter = new MaterialFilter(getFilterTemplate());

		this.setMunitList(munitService.getEmbAll());
	}

	public List<MUnitEmb> getMunitList()
	{
		return munitList;
	}

	public void setMunitList(List<MUnitEmb> munitList)
	{
		this.munitList = munitList;
	}

}
