IDEMPIERE-1749 Add window event validator for AD_Window

This commit is contained in:
Heng Sin Low 2014-02-18 00:16:41 +08:00
parent 0196907539
commit 4f8e31bdd3
2 changed files with 6 additions and 3 deletions

View File

@ -2392,7 +2392,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
dialog.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() { dialog.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() {
@Override @Override
public void onEvent(Event event) throws Exception { public void onEvent(Event event) throws Exception {
postCallback.onCallback(dialog.isCancel()); postCallback.onCallback(!dialog.isCancel());
} }
}); });
} }

View File

@ -28,15 +28,18 @@ public class WindowValidatorManager implements BundleActivator, ServiceTrackerCu
ServiceReference<WindowValidator> reference) { ServiceReference<WindowValidator> reference) {
WindowValidator service = context.getService(reference); WindowValidator service = context.getService(reference);
String uuid = (String) reference.getProperty("AD_Window_UU"); String uuid = (String) reference.getProperty("AD_Window_UU");
if (uuid == null || "*".equals(uuid)) System.out.println("service="+service+" uuid="+uuid);
if (uuid == null || "*".equals(uuid)) {
globalValidators.add(service); globalValidators.add(service);
return service;
}
List<WindowValidator> list = validatorMap.get(uuid); List<WindowValidator> list = validatorMap.get(uuid);
if (list == null) { if (list == null) {
list = new ArrayList<WindowValidator>(); list = new ArrayList<WindowValidator>();
validatorMap.put(uuid, list); validatorMap.put(uuid, list);
} }
list.add(service); list.add(service);
return service; return service;
} }