IDEMPIERE-5005 - Chat window broken (#935)

* IDEMPIERE-5005 - Chat window broken

Fix event processing on chat window

* IDEMPIERE-5005 - Chat window broken

Removed confirm panel as it servers no other purpose than closing the
window.
This commit is contained in:
Saulo José Gil 2021-10-19 10:12:21 -03:00 committed by GitHub
parent 6a56596f10
commit aeb45c6192
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 16 deletions

View File

@ -24,9 +24,7 @@ import java.util.logging.Level;
import org.adempiere.webui.AdempiereWebUI; import org.adempiere.webui.AdempiereWebUI;
import org.adempiere.webui.ClientInfo; import org.adempiere.webui.ClientInfo;
import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.component.Button; import org.adempiere.webui.component.Button;
import org.adempiere.webui.component.ConfirmPanel;
import org.adempiere.webui.component.Label; import org.adempiere.webui.component.Label;
import org.adempiere.webui.component.Textbox; import org.adempiere.webui.component.Textbox;
import org.adempiere.webui.component.Window; import org.adempiere.webui.component.Window;
@ -127,7 +125,6 @@ public class WChat extends Window implements EventListener<Event>, DialogEvents
private Borderlayout mainPanel = new Borderlayout(); private Borderlayout mainPanel = new Borderlayout();
private Textbox newText = new Textbox(); private Textbox newText = new Textbox();
private ConfirmPanel confirmPanel = new ConfirmPanel(true);
private Tree messageTree = new Tree(); private Tree messageTree = new Tree();
private Button addButton; private Button addButton;
private Map<Integer, Component> entryMap = new HashMap<Integer, Component>(); private Map<Integer, Component> entryMap = new HashMap<Integer, Component>();
@ -172,10 +169,6 @@ public class WChat extends Window implements EventListener<Event>, DialogEvents
ZKUpdateUtil.setVflex(south, "min"); ZKUpdateUtil.setVflex(south, "min");
mainPanel.appendChild(south); mainPanel.appendChild(south);
LayoutUtils.addSclass("dialog-footer", confirmPanel);
confirmPanel.addActionListener(this);
south.appendChild(confirmPanel);
ZKUpdateUtil.setVflex(confirmPanel, "min");
if (!ThemeManager.isUseCSSForWindowSize()) if (!ThemeManager.isUseCSSForWindowSize())
{ {
@ -332,11 +325,7 @@ public class WChat extends Window implements EventListener<Event>, DialogEvents
*/ */
public void actionPerformed (Event e) public void actionPerformed (Event e)
{ {
if (e.getTarget().getId().equals(ConfirmPanel.A_OK)) if (e.getTarget() == addButton)
{
dispose();
}
else if (e.getTarget() == addButton)
{ {
String data = newText.getText(); String data = newText.getText();
if (data != null && data.length() > 0) if (data != null && data.length() > 0)
@ -391,10 +380,7 @@ public class WChat extends Window implements EventListener<Event>, DialogEvents
} // actionPerformed } // actionPerformed
public void onEvent(Event event) throws Exception { public void onEvent(Event event) throws Exception {
if (event.getTarget() == confirmPanel.getOKButton()) actionPerformed(event);
actionPerformed(event);
else if (event.getTarget() == confirmPanel.getButton(ConfirmPanel.A_CANCEL))
onCancel();
} }
private void onCancel() { private void onCancel() {