/****************************************************************************** * Product: iDempiere ERP & CRM Smart Business Solution * * Copyright (C) 2012 Trek Global * * This program is free software; you can redistribute it and/or modify it * * under the terms version 2 of the GNU General Public License as published * * by the Free Software Foundation. This program is distributed in the hope * * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * * with this program; if not, write to the Free Software Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * *****************************************************************************/ package org.adempiere.webui.panel; import org.adempiere.webui.component.Borderlayout; import org.adempiere.webui.component.Checkbox; import org.adempiere.webui.component.Column; import org.adempiere.webui.component.Columns; import org.adempiere.webui.component.Grid; import org.adempiere.webui.component.Row; import org.adempiere.webui.component.Rows; import org.adempiere.webui.component.Textbox; import org.adempiere.webui.component.Window; import org.adempiere.webui.util.ZKUpdateUtil; import org.compiere.print.MPrintFormat; import org.compiere.print.MPrintFormatItem; import org.compiere.util.KeyNamePair; import org.compiere.util.Language; import org.compiere.util.Util; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.Events; import org.zkoss.zul.Center; import org.zkoss.zul.Div; /** * Panel to select printed print format items */ public class WRC1DisplayFieldsPanel extends WRCTabPanel implements EventListener { /** * generated serial id */ private static final long serialVersionUID = -4595966853507636969L; private static final int RENDER_IN_COLUMNS=4; private MPrintFormat m_printFormat; protected Checkbox m_chkboxes[]=null; protected Textbox m_textBoxes[]=null; protected String m_oldLabel[]=null; /** * Default constructor */ public WRC1DisplayFieldsPanel() { super(); } /** * @param pf */ public WRC1DisplayFieldsPanel(MPrintFormat pf){ super(); m_printFormat=pf; } /** * @return print format */ public MPrintFormat getM_printFormat() { return m_printFormat; } /** * Layout panel */ public void init() { m_chkboxes = new Checkbox[m_pfi.size()]; m_textBoxes = new Textbox[m_pfi.size()]; m_oldLabel = new String[m_pfi.size()]; Window wind=new Window(); ZKUpdateUtil.setWidth(wind, "90%"); ZKUpdateUtil.setHeight(wind, "100%"); ZKUpdateUtil.setHflex(wind, "1"); Borderlayout borderlayout = new Borderlayout(); wind.appendChild(borderlayout); ZKUpdateUtil.setHflex(borderlayout, "1"); Center center = new Center(); center.setAutoscroll(true); borderlayout.appendChild(center); Grid grid = new Grid(); //have problem moving the following out as css class ZKUpdateUtil.setHflex(grid, "1"); ZKUpdateUtil.setHeight(grid, "90%"); ZKUpdateUtil.setVflex(grid, true); grid.setStyle("margin:0; padding:0; position: absolute"); grid.makeNoStrip(); Div div = new Div(); div.setStyle("width:90%;height:100%;border:none;margin:none;padding:none"); div.appendChild(grid); center.appendChild(div); this.appendChild(wind); Columns columns = new Columns(); grid.appendChild(columns); Column cols[] = new Column[2*RENDER_IN_COLUMNS]; int width = 100/RENDER_IN_COLUMNS; int widthChk = width/5; int widthTxt = widthChk*4; for(int i=0;i