IDEMPIERE-369 Master Detail layout improvements. Redraw event must execute as the last event.

This commit is contained in:
Heng Sin Low 2012-11-26 12:35:31 +08:00
parent 6ea176f61a
commit f8c002536e
3 changed files with 14 additions and 2 deletions

View File

@ -573,7 +573,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
adTabbox.getSelectedTabpanel().activate(true); adTabbox.getSelectedTabpanel().activate(true);
if (adTabbox.getSelectedTabpanel().isGridView()) { if (adTabbox.getSelectedTabpanel().isGridView()) {
Events.postEvent(new Event(CompositeADTabbox.ON_POST_INIT_EVENT, adTabbox.getComponent())); Events.postEvent(new Event(CompositeADTabbox.ON_POST_INIT_EVENT, adTabbox.getComponent(), null));
} }
} }

View File

@ -42,6 +42,7 @@ import org.zkoss.zk.ui.HtmlBasedComponent;
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.sys.ExecutionCtrl;
import org.zkoss.zk.ui.util.Clients; import org.zkoss.zk.ui.util.Clients;
import org.zkoss.zul.Menuitem; import org.zkoss.zul.Menuitem;
import org.zkoss.zul.Vlayout; import org.zkoss.zul.Vlayout;
@ -204,6 +205,11 @@ public class CompositeADTabbox extends AbstractADTabbox
layout.addEventListener(ON_POST_INIT_EVENT, new EventListener<Event>() { layout.addEventListener(ON_POST_INIT_EVENT, new EventListener<Event>() {
@Override @Override
public void onEvent(Event event) throws Exception { public void onEvent(Event event) throws Exception {
ExecutionCtrl ctrl = (ExecutionCtrl) Executions.getCurrent();
if (ctrl.getNextEvent() != null) {
Events.postEvent(new Event(ON_POST_INIT_EVENT, layout));
return;
}
LayoutUtils.redraw(layout); LayoutUtils.redraw(layout);
} }
}); });
@ -561,7 +567,7 @@ public class CompositeADTabbox extends AbstractADTabbox
detailTab.setDetailPaneMode(true, isUseVflexForDetailPane()); detailTab.setDetailPaneMode(true, isUseVflexForDetailPane());
detailPane.setVflex(Boolean.toString(isUseVflexForDetailPane())); detailPane.setVflex(Boolean.toString(isUseVflexForDetailPane()));
if (!ADTabpanel.isUseSplitViewForForm() && !headerTab.isGridView()) { if (!ADTabpanel.isUseSplitViewForForm() && !headerTab.isGridView()) {
Events.echoEvent(new Event(DetailPane.ON_REDRAW_EVENT, detailPane)); Events.postEvent(new Event(DetailPane.ON_REDRAW_EVENT, detailPane));
} }
} }
} }

View File

@ -28,6 +28,7 @@ import org.zkoss.zk.ui.Page;
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.sys.ExecutionCtrl;
import org.zkoss.zk.ui.util.Clients; import org.zkoss.zk.ui.util.Clients;
import org.zkoss.zul.Caption; import org.zkoss.zul.Caption;
import org.zkoss.zul.Div; import org.zkoss.zul.Div;
@ -396,6 +397,11 @@ public class DetailPane extends Panel implements EventListener<Event> {
} else if (event.getName().equals(ADTabpanel.ON_DYNAMIC_DISPLAY_EVENT)) { } else if (event.getName().equals(ADTabpanel.ON_DYNAMIC_DISPLAY_EVENT)) {
updateProcessToolbar(); updateProcessToolbar();
} else if (event.getName().equals(ON_REDRAW_EVENT)) { } else if (event.getName().equals(ON_REDRAW_EVENT)) {
ExecutionCtrl ctrl = (ExecutionCtrl) Executions.getCurrent();
if (ctrl.getNextEvent() != null) {
Events.postEvent(new Event(ON_REDRAW_EVENT, this));
return;
}
LayoutUtils.redraw(this); LayoutUtils.redraw(this);
} }
} }