IDEMPIERE-547 Zk: Shouldn't open embedded window as overlapped window. Fixed for document action dialog.

This commit is contained in:
Heng Sin Low 2013-01-14 17:40:47 +08:00
parent 44d863d488
commit 79bc88e332
4 changed files with 39 additions and 6 deletions

View File

@ -25,6 +25,7 @@ import org.zkoss.zk.ui.util.Clients;
import org.zkoss.zul.Borderlayout;
import org.zkoss.zul.Div;
import org.zkoss.zul.Window;
import org.zkoss.zul.Window.Mode;
/**
*
@ -148,6 +149,7 @@ public final class LayoutUtils {
.append(position)
.append("');");
window.setVisible(true);
window.setMode(Mode.EMBEDDED);
Clients.response("_openPopupWindow_", new AuScript(window, script.toString()));
}

View File

@ -802,6 +802,8 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
private FindWindow findWindow;
private Div maskDiv;
/**
* @see ToolbarListener#onLock()
*/
@ -2376,10 +2378,9 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
else
{
final int recordIdParam = record_ID;
getComponent().getParent().appendChild(win);
win.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() {
public void onEvent(Event event) throws Exception {
Clients.clearBusy(getComponent().getParent());
hideMaskDiv();
getComponent().invalidate();
if (!win.isStartProcess()) {
return;
@ -2389,8 +2390,12 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
executeButtonProcess(wButton, startWOasking, table_ID, recordIdParam, isProcessMandatory);
}
});
Clients.showBusy(getComponent().getParent(), " ");
LayoutUtils.openOverlappedWindow(getComponent(), win, "middle_center");
getComponent().getParent().appendChild(getMaskDiv());
getComponent().getParent().appendChild(win);
win.setContentStyle("background-color: #fff;");
LayoutUtils.openEmbeddedWindow(getComponent(), win, "middle_center");
win.setSclass("embedded-dialog");
win.focus();
return;
}
} // DocAction
@ -2500,6 +2505,21 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
isProcessMandatory);
} // actionButton
private Div getMaskDiv() {
if (maskDiv == null) {
maskDiv = new Div();
maskDiv.setStyle("position: absolute; width: 100%; height: 100%; border: none; margin: 0; background-color: #e4e4e4; " +
"padding: 0; z-index:999; opacity:0.6; top: 0px; left: 0px;");
}
return maskDiv;
}
private void hideMaskDiv() {
if (maskDiv != null && maskDiv.getParent() != null) {
maskDiv.detach();
}
}
private void executeButtonProcess(final IProcessButton wButton,
final boolean startWOasking, final int table_ID, final int record_ID,
boolean isProcessMandatory) {

View File

@ -273,6 +273,8 @@ public class WDocActionPanel extends Window implements EventListener<Event>, Dia
this.setTitle(Msg.translate(Env.getCtx(), "DocAction"));
this.setWidth("410px");
this.setBorder("normal");
this.setStyle("position: absolute");
this.setZindex(1000);
this.appendChild(grid);
}

View File

@ -1024,3 +1024,12 @@ tbody.z-grid-empty-body td {
border-bottom: 1px solid #CFCFCF !important;
border-top: 1px solid #CFCFCF !important;
}
.embedded-dialog {
background-color: #666;
}
.embedded-dialog .z-window-embedded-header {
color: #fff;
font-weight: bold;
}