diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/LayoutUtils.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/LayoutUtils.java index e2a6ddbd66..a6a0ca197b 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/LayoutUtils.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/LayoutUtils.java @@ -132,6 +132,25 @@ public final class LayoutUtils { Clients.response("_openPopupWindow_", new AuScript(window, script.toString())); } + /** + * open popup window relative to the ref component + * @param ref + * @param window + * @param position + */ + public static void openEmbeddedWindow(Component ref, Window window, String position) { + StringBuilder script = new StringBuilder(); + script.append("_idempiere_popup_window('#") + .append(ref.getUuid()) + .append("','#") + .append(window.getUuid()) + .append("','") + .append(position) + .append("');"); + window.setVisible(true); + Clients.response("_openPopupWindow_", new AuScript(window, script.toString())); + } + public static void redraw(AbstractComponent component) { StringWriter writer = new StringWriter(1024); try { diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java index fe536564e2..98e4890561 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java @@ -667,15 +667,13 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements callback.onCallback(null); } } - }); - findWindow.setTitle(null); - findWindow.setBorder("none"); - findWindow.setStyle("padding: 5px;"); + }); + setupEmbeddedFindwindow(); getComponent().addEventListener("onInitialQuery", new EventListener() { @Override public void onEvent(Event event) throws Exception { getComponent().getParent().appendChild(findWindow); - LayoutUtils.openOverlappedWindow(getComponent(), findWindow, "overlap"); + LayoutUtils.openEmbeddedWindow(getComponent(), findWindow, "overlap"); } }); Events.echoEvent("onInitialQuery", getComponent(), null); @@ -691,6 +689,15 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements } } // initialQuery + private void setupEmbeddedFindwindow() { + findWindow.setTitle(null); + findWindow.setBorder("none"); + findWindow.setStyle("position: absolute; border-bottom: 1px solid #c5c5c5; padding: 2px; background-color: #fff;"); + findWindow.setWidth("100%"); + findWindow.setZindex(1000); + findWindow.setContentStyle("background-color: #fff; width: 99%; margin: auto;"); + } + public String getTitle() { return title; @@ -1579,8 +1586,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements adTabbox.getSelectedGridTab().getAD_Table_ID(), adTabbox.getSelectedGridTab().getTableName(), adTabbox.getSelectedGridTab().getWhereExtended(), findFields, 1, adTabbox.getSelectedGridTab().getAD_Tab_ID()); - findWindow.setBorder("none"); - findWindow.setStyle("padding: 5px;"); + setupEmbeddedFindwindow(); if (!findWindow.initialize()) { if (findWindow.getTotalRecords() == 0) { FDialog.info(curWindowNo, getComponent(), "NoRecordsFound"); @@ -1593,8 +1599,6 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements findWindow.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener() { @Override public void onEvent(Event event) throws Exception { - Clients.clearBusy(getComponent().getParent()); - getComponent().invalidate(); if (!findWindow.isCancel()) { MQuery query = findWindow.getQuery(); @@ -1621,9 +1625,8 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements }); } findWindow.setTitle(null); - getComponent().getParent().appendChild(findWindow); - Clients.showBusy(getComponent().getParent(), " "); - LayoutUtils.openOverlappedWindow(toolbar, findWindow, "after_start"); + getComponent().getParent().insertBefore(findWindow, getComponent().getParent().getFirstChild()); + LayoutUtils.openEmbeddedWindow(toolbar, findWindow, "after_start"); } /** diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java index 29c0b895f1..b3305c22b3 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java @@ -96,6 +96,7 @@ import org.zkoss.zul.Comboitem; import org.zkoss.zul.Div; import org.zkoss.zul.Hbox; import org.zkoss.zul.South; +import org.zkoss.zul.Space; import org.zkoss.zul.Tab; import org.zkoss.zul.Vlayout; @@ -237,7 +238,6 @@ public class FindWindow extends Window implements EventListener, ValueCha this.setWidth("900px"); this.setHeight("350px"); this.setTitle(Msg.getMsg(Env.getCtx(), "Find").replaceAll("&", "") + ": " + title); - this.setAttribute(Window.MODE_KEY, Window.MODE_HIGHLIGHTED); this.setClosable(false); this.setSizable(true); this.setMaximizable(true); @@ -353,7 +353,11 @@ public class FindWindow extends Window implements EventListener, ValueCha column = new Column(); column.setAlign("left"); - column.setWidth("70%"); + column.setWidth("50%"); + columns.appendChild(column); + + column = new Column(); + column.setWidth("20%"); columns.appendChild(column); contentSimple.appendChild(columns); @@ -420,7 +424,6 @@ public class FindWindow extends Window implements EventListener, ValueCha toolBar.appendChild(btnDelete); toolBar.setWidth("100%"); - fQueryName.setStyle("margin-left: 3px; margin-right: 3px; position: relative; top: 5px;"); fQueryName.addEventListener(Events.ON_SELECT, this); Hbox confirmPanel = new Hbox(); @@ -510,7 +513,7 @@ public class FindWindow extends Window implements EventListener, ValueCha btnSave.addEventListener(Events.ON_CLICK, this); btnSave.setDisabled(true); btnSave.setId("btnSave"); -// LayoutUtils.addSclass("disableFilter", btnSave); + btnSave.setStyle("vertical-align: middle;"); fQueryName = new Combobox(); fQueryName.setTooltiptext(Msg.getMsg(Env.getCtx(),"QueryName")); @@ -525,32 +528,34 @@ public class FindWindow extends Window implements EventListener, ValueCha fQueryName.addEventListener(Events.ON_SELECT, this); Label label = new Label(Msg.getMsg(Env.getCtx(), "SavedQuery")); + label.setStyle("vertical-align: middle;"); div.appendChild(label); div.appendChild(fQueryName); div.appendChild(btnSave); - fQueryName.setStyle("margin-left: 3px; margin-right: 3px; position: relative;"); + fQueryName.setStyle("margin-left: 3px; margin-right: 3px; position: relative; vertical-align: middle;"); msgLabel = new Label(""); - msgLabel.setStyle("margin-left: 10px; margin-right: 20px;"); + msgLabel.setStyle("margin-left: 10px; margin-right: 20px; vertical-align: middle;"); div.appendChild(msgLabel); // adding history combo prepareHistoryCombo(); Label labelHistory = new Label(Msg.getMsg(Env.getCtx(), HISTORY_LABEL)); + labelHistory.setStyle("vertical-align: middle;"); div.appendChild(labelHistory); div.appendChild(historyCombo); - historyCombo.setStyle("margin-left: 3px; margin-right: 3px; position: relative;"); + historyCombo.setStyle("margin-left: 3px; margin-right: 3px; position: relative; vertical-align: middle;"); winMain = new MultiTabPart(); winMain.createPart(layout); - winMain.getComponent().setStyle("width: 99%; position: relative; margin-left: auto; margin-right: auto; margin-top: 5px;"); + winMain.getComponent().setStyle("position: relative; margin-left: auto; margin-right: auto; margin-top: 3px; margin-bottom: 3px;"); winMain.getComponent().setVflex("1"); winMain.getComponent().addEventListener(Events.ON_SELECT, this); winAdvanced = new Window(); winLookupRecord = new Window(); Tabpanel tabPanel = new Tabpanel(); - tabPanel.setStyle("height: 100%; width: 100%"); + tabPanel.setStyle("height: 100%; width: 99%; padding-right: 2px; margin: auto;"); tabPanel.appendChild(winLookupRecord); tabPanel.setId("simpleSearch"); winMain.addTab(tabPanel, Msg.getMsg(Env.getCtx(), "Find").replaceAll("&", ""),false, true); @@ -958,7 +963,8 @@ public class FindWindow extends Window implements EventListener, ValueCha // Editor WEditor editor = null; - editor = WebEditorFactory.getEditor(mField, false); + //false will use hflex which is render 1 pixel too width on firefox + editor = WebEditorFactory.getEditor(mField, true); editor.setMandatory(false); editor.setReadWrite(true); editor.dynamicDisplay(); @@ -974,6 +980,7 @@ public class FindWindow extends Window implements EventListener, ValueCha Row panel = new Row(); panel.appendChild(label); panel.appendChild(fieldEditor); + panel.appendChild(new Space()); contentSimpleRows.appendChild(panel); m_sEditors.add(editor);