/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rjconsultores.ventaboletos.web.utilerias.render;

import com.rjconsultores.ventaboletos.entidad.PricingRuta;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;

/**
 *
 * @author Rafius
 */
public class RenderPricingRuta implements ListitemRenderer {

    public void render(Listitem lstm, Object o) throws Exception {
        PricingRuta pc = (PricingRuta) o;

        Listcell lc = new Listcell();

        if (pc.getRuta() != null) {
            lc = new Listcell(pc.getRuta().getRutaId().toString() + " - " + pc.getRuta().getDescruta() + " - " + pc.getRuta().getPrefixo() );
        } else {
            lc = new Listcell("-");
        }
        lc.setParent(lstm);

        lstm.setAttribute("data", pc);
    }
}
