* fixed javascript error with menu search panel

* fixed account viewer dialog
* more complete statusbar implementation
This commit is contained in:
Heng Sin Low 2008-07-11 23:53:01 +00:00
parent 18560bb382
commit 3cf71dc419
6 changed files with 97 additions and 42 deletions

View File

@ -23,7 +23,6 @@ import java.util.Iterator;
import java.util.logging.Level;
import org.adempiere.webui.apps.AEnv;
import org.adempiere.webui.apps.ProcessModalDialog;
import org.adempiere.webui.component.Button;
import org.adempiere.webui.component.Checkbox;
import org.adempiere.webui.component.Datebox;
@ -54,8 +53,10 @@ import org.compiere.util.ValueNamePair;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zkex.zul.Borderlayout;
import org.zkoss.zkex.zul.Center;
import org.zkoss.zkex.zul.South;
import org.zkoss.zul.Caption;
import org.zkoss.zul.Div;
import org.zkoss.zul.Groupbox;
import org.zkoss.zul.Hbox;
import org.zkoss.zul.Listcell;
@ -181,7 +182,7 @@ public class WAcctViewer extends Window implements EventListener
try
{
jbInit();
init();
dynInit (AD_Table_ID, Record_ID);
AEnv.showWindow(this);
}
@ -204,7 +205,7 @@ public class WAcctViewer extends Window implements EventListener
* @throws Exception
*/
private void jbInit() throws Exception
private void init() throws Exception
{
// Selection Panel
@ -486,17 +487,14 @@ public class WAcctViewer extends Window implements EventListener
// Result Tab
Div div = new Div();
div.setStyle("overflow:auto");
div.setWidth("100%");
div.appendChild(table);
table.setWidth("1200px");
table.setMold("paging");
table.setPageSize(10);
table.setWidth("99%;");
// table.setMold("paging");
// table.setPageSize(10);
table.setVflex(true);
result.setWidth("100%");
result.appendChild(div);
result.setHeight("100%");
result.appendChild(table);
// Query Tab
@ -519,13 +517,27 @@ public class WAcctViewer extends Window implements EventListener
tabpanels.appendChild(result);
tabbedPane.setWidth("100%");
tabbedPane.setHeight("100%");
tabbedPane.appendChild(tabs);
tabbedPane.appendChild(tabpanels);
VerticalBox mainBox = new VerticalBox();
mainBox.setWidth("100%");
mainBox.appendChild(tabbedPane);
mainBox.appendChild(southPanel);
Borderlayout layout = new Borderlayout();
layout.setParent(this);
layout.setHeight("100%");
layout.setWidth("100%");
layout.setStyle("background-color: transparent");
Center center = new Center();
center.setParent(layout);
center.setFlex(true);
center.setStyle("background-color: transparent");
tabbedPane.setParent(center);
South south = new South();
south.setParent(layout);
south.setFlex(true);
south.setStyle("background-color: transparent");
southPanel.setParent(south);
this.setAttribute("mode", "modal");
this.setTitle("Posting");
@ -533,7 +545,7 @@ public class WAcctViewer extends Window implements EventListener
this.setClosable(true);
this.setWidth("800px");
this.setHeight("500px");
this.appendChild(mainBox);
this.setSizable(true);
//tabbedPane.addEventListener(Events.ON_SELECT, this);
}
@ -897,6 +909,7 @@ public class WAcctViewer extends Window implements EventListener
if (table.getListhead() == null)
{
Listhead listhead = new Listhead();
listhead.setSizable(true);
for (int i = 0; i < rmodel.getColumnCount(); i++)
{

View File

@ -699,7 +699,7 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
String trxInfo = curTab.getTrxInfo();
if (trxInfo != null)
{
// statusBar.setInfo(trxInfo);
statusBar.setInfo(trxInfo);
}
// Check Attachment

View File

@ -237,4 +237,9 @@ public class MenuPanel extends Panel implements EventListener
{
return true;
}
public Tree getMenuTree()
{
return menuTree;
}
}

View File

@ -25,6 +25,7 @@ import org.adempiere.webui.component.Panel;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zk.ui.util.Clients;
import org.zkoss.zul.Treeitem;
/**
@ -110,10 +111,17 @@ public class MenuSearchPanel extends Panel implements EventListener
if (treeItem != null)
{
select(treeItem);
Events.echoEvent(Events.ON_SELECT, treeItem.getTree(), null);
Clients.showBusy("Loding...", true);
Events.echoEvent("onPostSelect", this, null);
}
}
}
public void onPostSelect() {
Clients.showBusy(null, false);
Event event = new Event(Events.ON_SELECT, menuPanel.getMenuTree());
Events.postEvent(event);
}
private void select(Treeitem selectedItem) {
Treeitem parent = selectedItem.getParentItem();
@ -124,6 +132,5 @@ public class MenuSearchPanel extends Panel implements EventListener
parent = parent.getParentItem();
}
selectedItem.getTree().setSelectedItem(selectedItem);
selectedItem.focus();
}
}

View File

@ -17,11 +17,14 @@
package org.adempiere.webui.panel;
import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.component.Label;
import org.adempiere.webui.component.Panel;
import org.adempiere.webui.component.VerticalBox;
import org.compiere.model.DataStatusEvent;
import org.zkoss.zul.Div;
import org.zkoss.zul.Hbox;
import org.zkoss.zul.Separator;
import org.zkoss.zul.Vbox;
/**
* This class is based on org.compiere.apps.StatusBar written by Jorg Janke.
@ -37,6 +40,7 @@ public class StatusBarPanel extends Panel
private Label statusDB;
private Label statusLine;
private Label infoLine;
public StatusBarPanel()
{
@ -47,19 +51,38 @@ public class StatusBarPanel extends Panel
private void init()
{
statusLine = new Label();
//statusLine.setWidth("100%");
statusDB = new Label();
statusDB.setWidth("200px");
infoLine = new Label();
Hbox hbox = new Hbox();
hbox.appendChild(statusLine);
hbox.appendChild(statusDB);
hbox.setWidth("100%");
hbox.setHeight("100%");
hbox.setWidths("50%, 50%");
Div div = new Div();
div.setStyle("text-align: left; ");
div.appendChild(statusLine);
div.setWidth("100%");
Vbox vbox = new Vbox();
vbox.setPack("center");
LayoutUtils.addSclass("status", vbox);
vbox.appendChild(div);
hbox.appendChild(vbox);
VerticalBox mainBox = new VerticalBox();
mainBox.appendChild(hbox);
div = new Div();
div.setWidth("100%");
div.setStyle("text-align: right; ");
div.appendChild(infoLine);
div.appendChild(statusDB);
statusDB.setStyle("");
LayoutUtils.addSclass("status-db", statusDB);
LayoutUtils.addSclass("status-info", infoLine);
vbox = new Vbox();
vbox.setPack("center");
LayoutUtils.addSclass("status", vbox);
vbox.appendChild(div);
hbox.appendChild(vbox);
this.appendChild(mainBox);
this.appendChild(hbox);
}
public void setStatusDB (String text)
@ -90,4 +113,13 @@ public class StatusBarPanel extends Panel
{
statusLine.setValue(text);
}
/**
* Set Info Line
* @param text text
*/
public void setInfo (String text)
{
infoLine.setValue(text);
} // setInfo
}

View File

@ -49,21 +49,18 @@ import org.zkoss.zul.Caption;
import org.zkoss.zul.Div;
import org.zkoss.zul.Groupbox;
import org.zkoss.zul.Hbox;
import org.zkoss.zul.Separator;
import org.zkoss.zul.Vbox;
/**
* Dialog to enter Account Info
*
* @author Jorg Janke
* @version $Id: VAccountDialog.java,v 1.3 2006/07/30 00:51:28 jjanke Exp $
* @author Low Heng Sin
*/
public final class WAccountDialog extends Window
implements EventListener, DataStatusListener, ValueChangeListener
{
/**
* Constructor
* @param frame frame
* @param title title
* @param mAccount account info
* @param C_AcctSchema_ID as
@ -93,7 +90,7 @@ public final class WAccountDialog extends Window
AEnv.showCenterScreen(this);
else
dispose();
} // VLocationDialog
} // WAccountDialog
/** Window No */
private int m_WindowNo;
@ -152,13 +149,14 @@ public final class WAccountDialog extends Window
/**
* Static component init.
* <pre>
* - panel
* - northPanel
* - parameterPanel
* - toolBar
* - gridController
* - confirmPanel
* - statusBar
* - north
* - parameterPanel
* - toolBar
* - center
* - adtabpanel
* - south
* - confirmPanel
* - statusBar
* </pre>
* @throws Exception
*/