IDEMPIERE-290 Zk6: Send Email Dialog layout broken after migration to Zk6

This commit is contained in:
Heng Sin Low 2012-06-06 22:26:42 +08:00
parent 668e61686f
commit 20c846a64c
1 changed files with 35 additions and 27 deletions

View File

@ -23,6 +23,8 @@ import java.util.StringTokenizer;
import java.util.logging.Level; import java.util.logging.Level;
import org.adempiere.webui.apps.AEnv; import org.adempiere.webui.apps.AEnv;
import org.adempiere.webui.component.Column;
import org.adempiere.webui.component.Columns;
import org.adempiere.webui.component.ConfirmPanel; import org.adempiere.webui.component.ConfirmPanel;
import org.adempiere.webui.component.Grid; import org.adempiere.webui.component.Grid;
import org.adempiere.webui.component.Label; import org.adempiere.webui.component.Label;
@ -66,7 +68,7 @@ import org.zkoss.zul.Separator;
* globalqss - Carlos Ruiz - implement CC - FR [ 1754879 ] Enhancements on sending e-mail * globalqss - Carlos Ruiz - implement CC - FR [ 1754879 ] Enhancements on sending e-mail
* *
*/ */
public class WEMailDialog extends Window implements EventListener, ValueChangeListener public class WEMailDialog extends Window implements EventListener<Event>, ValueChangeListener
{ {
/** /**
* *
@ -89,7 +91,7 @@ public class WEMailDialog extends Window implements EventListener, ValueChangeLi
super(); super();
this.setTitle(title); this.setTitle(title);
this.setWidth("500px"); this.setWidth("500px");
this.setHeight("500px"); this.setHeight("600px");
this.setClosable(true); this.setClosable(true);
this.setBorder("normal"); this.setBorder("normal");
this.setStyle("position:absolute"); this.setStyle("position:absolute");
@ -152,10 +154,6 @@ public class WEMailDialog extends Window implements EventListener, ValueChangeLi
/** Logger */ /** Logger */
private static CLogger log = CLogger.getCLogger(WEMailDialog.class); private static CLogger log = CLogger.getCLogger(WEMailDialog.class);
// private CPanel mainPanel = new CPanel();
// private BorderLayout mainLayout = new BorderLayout();
// private CPanel headerPanel = new CPanel();
// private GridBagLayout headerLayout = new GridBagLayout();
private Textbox fFrom = new Textbox();//20); private Textbox fFrom = new Textbox();//20);
private Textbox fTo = new Textbox();//20); private Textbox fTo = new Textbox();//20);
private Textbox fCc = new Textbox();//20); private Textbox fCc = new Textbox();//20);
@ -187,10 +185,19 @@ public class WEMailDialog extends Window implements EventListener, ValueChangeLi
// //
Grid grid = new Grid(); Grid grid = new Grid();
grid.setWidth("480px"); grid.setWidth("100%");
grid.setStyle("margin:0; padding:0; position: absolute; align: center; valign: center;"); grid.setHeight("100%");
grid.setStyle("margin:0; padding:0; position: absolute; align: center; valign: center; border:0");
grid.makeNoStrip(); grid.makeNoStrip();
grid.setOddRowSclass("even");
Columns columns = new Columns();
Column column = new Column();
column.setWidth("30%");
columns.appendChild(column);
column = new Column();
column.setWidth("70%");
columns.appendChild(column);
grid.appendChild(columns);
Rows rows = new Rows(); Rows rows = new Rows();
grid.appendChild(rows); grid.appendChild(rows);
@ -202,7 +209,7 @@ public class WEMailDialog extends Window implements EventListener, ValueChangeLi
div.appendChild(lFrom); div.appendChild(lFrom);
row.appendChild(div); row.appendChild(div);
row.appendChild(fFrom); row.appendChild(fFrom);
fFrom.setWidth("100%"); fFrom.setHflex("1");
row = new Row(); row = new Row();
rows.appendChild(row); rows.appendChild(row);
@ -211,13 +218,13 @@ public class WEMailDialog extends Window implements EventListener, ValueChangeLi
div.appendChild(lTo); div.appendChild(lTo);
row.appendChild(div); row.appendChild(div);
row.appendChild(fUser.getComponent()); row.appendChild(fUser.getComponent());
fUser.getComponent().setWidth("100%"); fUser.getComponent().setHflex("1");
row = new Row(); row = new Row();
rows.appendChild(row); rows.appendChild(row);
row.appendChild(new Label("")); row.appendChild(new Label(""));
row.appendChild(fTo); row.appendChild(fTo);
fTo.setWidth("100%"); fTo.setHflex("1");
row = new Row(); row = new Row();
rows.appendChild(row); rows.appendChild(row);
@ -226,13 +233,13 @@ public class WEMailDialog extends Window implements EventListener, ValueChangeLi
div.appendChild(lCc); div.appendChild(lCc);
row.appendChild(div); row.appendChild(div);
row.appendChild(fCcUser.getComponent()); row.appendChild(fCcUser.getComponent());
fCcUser.getComponent().setWidth("100%"); fCcUser.getComponent().setHflex("1");
row = new Row(); row = new Row();
rows.appendChild(row); rows.appendChild(row);
row.appendChild(new Label("")); row.appendChild(new Label(""));
row.appendChild(fCc); row.appendChild(fCc);
fCc.setWidth("100%"); fCc.setHflex("1");
row = new Row(); row = new Row();
rows.appendChild(row); rows.appendChild(row);
@ -246,7 +253,7 @@ public class WEMailDialog extends Window implements EventListener, ValueChangeLi
div.appendChild(lSubject); div.appendChild(lSubject);
row.appendChild(div); row.appendChild(div);
row.appendChild(fSubject); row.appendChild(fSubject);
fSubject.setWidth("100%"); fSubject.setHflex("1");
row = new Row(); row = new Row();
rows.appendChild(row); rows.appendChild(row);
@ -260,35 +267,36 @@ public class WEMailDialog extends Window implements EventListener, ValueChangeLi
div.appendChild(lAttachment); div.appendChild(lAttachment);
row.appendChild(div); row.appendChild(div);
row.appendChild(fAttachment); row.appendChild(fAttachment);
fAttachment.setWidth("100%"); fAttachment.setHflex("1");
row = new Row(); row = new Row();
rows.appendChild(row); rows.appendChild(row);
row.setSpans("2"); row.setSpans("2");
row.appendChild(fMessage); row.appendChild(fMessage);
fMessage.setWidth("100%"); fMessage.setHflex("1");
fMessage.setRows(10); fMessage.setRows(10);
row = new Row();
rows.appendChild(row);
row.setSpans("2");
row.appendChild(confirmPanel);
confirmPanel.addActionListener(this); confirmPanel.addActionListener(this);
Borderlayout layout = new Borderlayout(); Borderlayout layout = new Borderlayout();
layout.setWidth("490px"); layout.setWidth("95%");
layout.setHeight("470px"); layout.setHeight("92%");
layout.setStyle("background-color: white; position: absolute;"); layout.setStyle("background-color: white; position: absolute; margin:0; border:0; padding:0");
Center center = new Center(); Center center = new Center();
center.appendChild(grid); center.appendChild(grid);
layout.appendChild(center); layout.appendChild(center);
center.setStyle("background-color: white"); center.setStyle("background-color: white; border: 0");
center.setFlex(true);
South south = new South(); South south = new South();
south.appendChild(statusBar); Div southDiv = new Div();
south.appendChild(southDiv);
layout.appendChild(south); layout.appendChild(south);
south.setStyle("background-color: white"); south.setStyle("background-color: white; border: 0");
southDiv.appendChild(confirmPanel);
southDiv.appendChild(statusBar);
this.appendChild(layout); this.appendChild(layout);
} // jbInit } // jbInit