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

View File

@ -237,4 +237,9 @@ public class MenuPanel extends Panel implements EventListener
{ {
return true; 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.Event;
import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events; import org.zkoss.zk.ui.event.Events;
import org.zkoss.zk.ui.util.Clients;
import org.zkoss.zul.Treeitem; import org.zkoss.zul.Treeitem;
/** /**
@ -110,10 +111,17 @@ public class MenuSearchPanel extends Panel implements EventListener
if (treeItem != null) if (treeItem != null)
{ {
select(treeItem); 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) { private void select(Treeitem selectedItem) {
Treeitem parent = selectedItem.getParentItem(); Treeitem parent = selectedItem.getParentItem();
@ -124,6 +132,5 @@ public class MenuSearchPanel extends Panel implements EventListener
parent = parent.getParentItem(); parent = parent.getParentItem();
} }
selectedItem.getTree().setSelectedItem(selectedItem); selectedItem.getTree().setSelectedItem(selectedItem);
selectedItem.focus();
} }
} }

View File

@ -17,11 +17,14 @@
package org.adempiere.webui.panel; package org.adempiere.webui.panel;
import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.component.Label; import org.adempiere.webui.component.Label;
import org.adempiere.webui.component.Panel; import org.adempiere.webui.component.Panel;
import org.adempiere.webui.component.VerticalBox;
import org.compiere.model.DataStatusEvent; import org.compiere.model.DataStatusEvent;
import org.zkoss.zul.Div;
import org.zkoss.zul.Hbox; 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. * 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 statusDB;
private Label statusLine; private Label statusLine;
private Label infoLine;
public StatusBarPanel() public StatusBarPanel()
{ {
@ -47,19 +51,38 @@ public class StatusBarPanel extends Panel
private void init() private void init()
{ {
statusLine = new Label(); statusLine = new Label();
//statusLine.setWidth("100%");
statusDB = new Label(); statusDB = new Label();
statusDB.setWidth("200px"); infoLine = new Label();
Hbox hbox = new Hbox(); Hbox hbox = new Hbox();
hbox.appendChild(statusLine); hbox.setWidth("100%");
hbox.appendChild(statusDB); 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(); div = new Div();
mainBox.appendChild(hbox); 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) public void setStatusDB (String text)
@ -90,4 +113,13 @@ public class StatusBarPanel extends Panel
{ {
statusLine.setValue(text); 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.Div;
import org.zkoss.zul.Groupbox; import org.zkoss.zul.Groupbox;
import org.zkoss.zul.Hbox; import org.zkoss.zul.Hbox;
import org.zkoss.zul.Separator;
import org.zkoss.zul.Vbox; import org.zkoss.zul.Vbox;
/** /**
* Dialog to enter Account Info * Dialog to enter Account Info
* *
* @author Jorg Janke * @author Low Heng Sin
* @version $Id: VAccountDialog.java,v 1.3 2006/07/30 00:51:28 jjanke Exp $
*/ */
public final class WAccountDialog extends Window public final class WAccountDialog extends Window
implements EventListener, DataStatusListener, ValueChangeListener implements EventListener, DataStatusListener, ValueChangeListener
{ {
/** /**
* Constructor * Constructor
* @param frame frame
* @param title title * @param title title
* @param mAccount account info * @param mAccount account info
* @param C_AcctSchema_ID as * @param C_AcctSchema_ID as
@ -93,7 +90,7 @@ public final class WAccountDialog extends Window
AEnv.showCenterScreen(this); AEnv.showCenterScreen(this);
else else
dispose(); dispose();
} // VLocationDialog } // WAccountDialog
/** Window No */ /** Window No */
private int m_WindowNo; private int m_WindowNo;
@ -152,13 +149,14 @@ public final class WAccountDialog extends Window
/** /**
* Static component init. * Static component init.
* <pre> * <pre>
* - panel * - north
* - northPanel * - parameterPanel
* - parameterPanel * - toolBar
* - toolBar * - center
* - gridController * - adtabpanel
* - confirmPanel * - south
* - statusBar * - confirmPanel
* - statusBar
* </pre> * </pre>
* @throws Exception * @throws Exception
*/ */