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);
}
public void showWithoutAfterCreate(ITab tab) {
show(tab, DO_NOTHING, false);
}
public void show(ITab tab, IBeforeShowAction beforeShowAction) {
show(tab, beforeShowAction, true);
}
private void show(ITab tab, IBeforeShowAction beforeShowAction,
boolean afterCreate) {
hideAllExcept(tab);
beforeShowAction.doAction();
if (afterCreate) {
tab.show();
} else {
tab.showWithoutAfterCreate();
}
tab.show();
parent.invalidate();
activateMenuIfRegistered(tab);
}

View file

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

View file

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

View file

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

View file

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

View file

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