IDEMPIERE-529 Search on empty table doesn't allow to close the window. Fitnesse test.

This commit is contained in:
Heng Sin Low 2013-02-05 23:01:41 +08:00
parent 401b046add
commit 92dc282c1c
4 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,14 @@
http://jira.idempiere.com/browse/IDEMPIERE-529
!include -c .ZkSuite.ZkGardenAdminLogin
!define windowId {$Activity__ABC__1}
Open Activity (ABC) window
|''open window''|!-Activity (ABC)-!|
|''wait response'' |
|''window'' |${windowId}|''click toolbar''|!-BtnFind-!|
|''click''|$MessageBox_Activity__ABC_ $btnOk|
|''window'' |${windowId}|''click toolbar''|!-BtnIgnore-!|
|''attribute''|class|''of''|${windowId} $BtnSave|is|!-toolbar-button disableFilter z-toolbarbutton z-toolbarbutton-disd-!|

View File

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<properties>
<Edit>true</Edit>
<Files>true</Files>
<Properties>true</Properties>
<RecentChanges>true</RecentChanges>
<Refactor>true</Refactor>
<Search>true</Search>
<Test/>
<Versions>true</Versions>
<WhereUsed>true</WhereUsed>
</properties>

View File

@ -20,6 +20,7 @@ package org.adempiere.webui.component;
import java.util.Properties;
import org.adempiere.util.Callback;
import org.adempiere.webui.AdempiereIdGenerator;
import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.apps.AEnv;
import org.compiere.util.Env;
@ -115,35 +116,42 @@ public class Messagebox extends Window implements EventListener<Event>
// Invert - Unify OK/Cancel IDEMPIERE-77
//btnOk.setLabel(Util.cleanAmp(Msg.getMsg(ctx, "OK")));
btnOk.setImage("/images/Ok16.png");
btnOk.setId("btnOk");
btnOk.addEventListener(Events.ON_CLICK, this);
LayoutUtils.addSclass("action-text-button", btnOk);
//btnCancel.setLabel(Util.cleanAmp(Msg.getMsg(ctx, "Cancel")));
btnCancel.setImage("/images/Cancel16.png");
btnCancel.addEventListener(Events.ON_CLICK, this);
btnCancel.setId("btnCancel");
LayoutUtils.addSclass("action-text-button", btnCancel);
btnYes.setLabel(Util.cleanAmp(Msg.getMsg(ctx, "Yes")));
btnYes.setImage("/images/Ok16.png");
btnYes.addEventListener(Events.ON_CLICK, this);
btnYes.setId("btnYes");
LayoutUtils.addSclass("action-text-button", btnYes);
btnNo.setLabel(Util.cleanAmp(Msg.getMsg(ctx, "No")));
btnNo.setImage("/images/Cancel16.png");
btnNo.addEventListener(Events.ON_CLICK, this);
btnNo.setId("btnNo");
LayoutUtils.addSclass("action-text-button", btnNo);
btnAbort.setLabel("Abort");
btnAbort.addEventListener(Events.ON_CLICK, this);
btnAbort.setId("btnAbort");
LayoutUtils.addSclass("action-text-button", btnAbort);
btnRetry.setLabel("Retry");
btnRetry.addEventListener(Events.ON_CLICK, this);
btnRetry.setId("btnRetry");
LayoutUtils.addSclass("action-text-button", btnRetry);
btnIgnore.setLabel("Ignore");
btnIgnore.setImage("/images/Ignore16.png");
btnIgnore.addEventListener(Events.ON_CLICK, this);
btnIgnore.setId("btnIgnore");
LayoutUtils.addSclass("action-text-button", btnIgnore);
Panel pnlMessage = new Panel();
@ -248,7 +256,7 @@ public class Messagebox extends Window implements EventListener<Event>
this.setSizable(true);
this.setVisible(true);
this.setId(title);
this.setId("MessageBox_"+AdempiereIdGenerator.escapeId(title));
AEnv.showCenterScreen(this);
return returnValue;

View File

@ -134,6 +134,7 @@ public class ZkFixture extends SpiderFixture {
public void openWindow(String label) {
Widget widget = new Widget("$treeSearchCombo");
String search = label.indexOf("&") > 0 ? label.substring(0, label.indexOf("&")) : label;
search = search.indexOf("(") > 0 ? search.substring(0, search.indexOf("(")) : search;
WebElement element = widget.$n(webDriver, "real");
element.sendKeys(search);
waitResponse();