Revert "Bug #1590: Fix problem calling several times the same method in OrderModel"
This reverts commit 7ca0d43883.
This commit is contained in:
parent
bf8b2fbe94
commit
2b4be85656
7 changed files with 4 additions and 51 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,8 +37,6 @@ public interface ITab {
|
|||
|
||||
void show();
|
||||
|
||||
void showWithoutAfterCreate();
|
||||
|
||||
void hide();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,11 +53,6 @@ public class TabProxy implements ITab {
|
|||
proxiedTab.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showWithoutAfterCreate() {
|
||||
proxiedTab.showWithoutAfterCreate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCssClass() {
|
||||
return proxiedTab.getCssClass();
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -472,7 +472,7 @@ public class MultipleTabsPlannerController implements Composer,
|
|||
@Override
|
||||
public void goToOrdersList() {
|
||||
// ordersTab.show();
|
||||
getTabsRegistry().showWithoutAfterCreate(ordersTab);
|
||||
getTabsRegistry().show(ordersTab);
|
||||
}
|
||||
|
||||
public void goToCreateForm() {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -140,13 +140,4 @@ public class TabOnModeType implements ITab {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showWithoutAfterCreate() {
|
||||
beingShown = true;
|
||||
ITab currentTab = getCurrentTab();
|
||||
if (currentTab != null) {
|
||||
currentTab.showWithoutAfterCreate();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue