Revert "Bug #1590: Fix problem calling several times the same method in OrderModel"

This reverts commit 7ca0d43883.
This commit is contained in:
Manuel Rego Casasnovas 2012-12-10 09:08:00 +01:00 committed by Óscar González Fernández
parent bf8b2fbe94
commit 2b4be85656
7 changed files with 4 additions and 51 deletions

View file

@ -65,23 +65,10 @@ public class TabsRegistry {
show(tab, DO_NOTHING); show(tab, DO_NOTHING);
} }
public void showWithoutAfterCreate(ITab tab) {
show(tab, DO_NOTHING, false);
}
public void show(ITab tab, IBeforeShowAction beforeShowAction) { public void show(ITab tab, IBeforeShowAction beforeShowAction) {
show(tab, beforeShowAction, true);
}
private void show(ITab tab, IBeforeShowAction beforeShowAction,
boolean afterCreate) {
hideAllExcept(tab); hideAllExcept(tab);
beforeShowAction.doAction(); beforeShowAction.doAction();
if (afterCreate) { tab.show();
tab.show();
} else {
tab.showWithoutAfterCreate();
}
parent.invalidate(); parent.invalidate();
activateMenuIfRegistered(tab); activateMenuIfRegistered(tab);
} }

View file

@ -37,8 +37,6 @@ public interface ITab {
void show(); void show();
void showWithoutAfterCreate();
void hide(); void hide();
} }

View file

@ -53,11 +53,6 @@ public class TabProxy implements ITab {
proxiedTab.show(); proxiedTab.show();
} }
@Override
public void showWithoutAfterCreate() {
proxiedTab.showWithoutAfterCreate();
}
@Override @Override
public String getCssClass() { public String getCssClass() {
return proxiedTab.getCssClass(); return proxiedTab.getCssClass();

View file

@ -72,21 +72,9 @@ public class CreatedOnDemandTab implements ITab {
@Override @Override
public void show() { public void show() {
show(true);
}
@Override
public void showWithoutAfterCreate() {
show(false);
}
private void show(boolean afterCreate) {
beforeShowAction(); beforeShowAction();
if (component == null) { if (component == null) {
component = componentCreator.create(parent); component = componentCreator.create(parent);
if (afterCreate) {
afterCreateAction(component);
}
} }
component.setParent(parent); component.setParent(parent);
afterShowAction(); afterShowAction();
@ -102,9 +90,6 @@ public class CreatedOnDemandTab implements ITab {
protected void beforeShowAction() { protected void beforeShowAction() {
} }
protected void afterCreateAction(Component component) {
}
protected void afterShowAction() { protected void afterShowAction() {
} }

View file

@ -472,7 +472,7 @@ public class MultipleTabsPlannerController implements Composer,
@Override @Override
public void goToOrdersList() { public void goToOrdersList() {
// ordersTab.show(); // ordersTab.show();
getTabsRegistry().showWithoutAfterCreate(ordersTab); getTabsRegistry().show(ordersTab);
} }
public void goToCreateForm() { public void goToCreateForm() {

View file

@ -68,6 +68,8 @@ public class OrdersTabCreator {
args.put("orderController", setupOrderCrudController()); args.put("orderController", setupOrderCrudController());
result = Executions.createComponents("/orders/_ordersTab.zul", result = Executions.createComponents("/orders/_ordersTab.zul",
parent, args); parent, args);
Util.createBindingsFor(result);
Util.reloadBindings(result);
return result; return result;
} }
@ -108,11 +110,6 @@ public class OrdersTabCreator {
} }
} }
@Override
protected void afterCreateAction(org.zkoss.zk.ui.Component component) {
Util.createBindingsFor(component);
}
@Override @Override
protected void afterShowAction() { protected void afterShowAction() {
orderCRUDController.goToList(); orderCRUDController.goToList();

View file

@ -140,13 +140,4 @@ public class TabOnModeType implements ITab {
} }
} }
@Override
public void showWithoutAfterCreate() {
beingShown = true;
ITab currentTab = getCurrentTab();
if (currentTab != null) {
currentTab.showWithoutAfterCreate();
}
}
} }