IDEMPIERE-1090 Toolbar buttons are always shown despite Display Logic

This commit is contained in:
Heng Sin Low 2013-06-23 11:21:27 +08:00
parent 8c05b86db1
commit fd3e1d8dd3
2 changed files with 8 additions and 1 deletions

View File

@ -54,6 +54,7 @@ import org.zkoss.zk.ui.event.Events;
import org.zkoss.zk.ui.event.KeyEvent;
import org.zkoss.zk.ui.util.Clients;
import org.zkoss.zul.Space;
import org.zkoss.zul.Toolbarbutton;
/**
*
@ -641,8 +642,10 @@ public class ADWindowToolbar extends FToolbar implements EventListener<Event>
}
public void dynamicDisplay() {
List<Toolbarbutton> customButtons = new ArrayList<Toolbarbutton>();
for(ToolbarCustomButton toolbarCustomBtn : toolbarCustomButtons) {
toolbarCustomBtn.dynamicDisplay();
customButtons.add(toolbarCustomBtn.getToolbarbutton());
}
ADWindow adwindow = ADWindow.findADWindow(this);
@ -653,7 +656,7 @@ public class ADWindowToolbar extends FToolbar implements EventListener<Event>
for (Component p = this.getFirstChild(); p != null; p = p.getNextSibling()) {
if (p instanceof ToolBarButton) {
if (!p.isVisible())
if (!customButtons.contains(p) && !p.isVisible())
p.setVisible(true);
}
}

View File

@ -80,4 +80,8 @@ public class ToolbarCustomButton implements EventListener<Event>, Evaluatee {
boolean visible = Evaluator.evaluateLogic(this, displayLogic);
toolbarButton.setVisible(visible);
}
public Toolbarbutton getToolbarbutton() {
return toolbarButton;
}
}