IDEMPIERE-1749 Add window event validator for AD_Window / Integrate sample test case provided by hengsin
This commit is contained in:
parent
410c9a1131
commit
36b7d1a0c5
|
@ -10,8 +10,10 @@ Import-Package: org.adempiere.base,
|
|||
org.adempiere.base.equinox,
|
||||
org.adempiere.exceptions,
|
||||
org.adempiere.plugin.utils,
|
||||
org.adempiere.util,
|
||||
org.adempiere.webui.action,
|
||||
org.adempiere.webui.adwindow,
|
||||
org.adempiere.webui.adwindow.validator,
|
||||
org.adempiere.webui.apps,
|
||||
org.adempiere.webui.component,
|
||||
org.adempiere.webui.window,
|
||||
|
@ -24,5 +26,6 @@ Import-Package: org.adempiere.base,
|
|||
org.zkoss.zul,
|
||||
org.zkoss.zul.event,
|
||||
org.zkoss.zul.impl
|
||||
Service-Component: OSGI-INF/export.xml
|
||||
Service-Component: OSGI-INF/export.xml,
|
||||
OSGI-INF/paymentwindowvalidator.xml
|
||||
Export-Package: action.images
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.adempiere.window.payment.validator.PaymentWindowValidator">
|
||||
<implementation class="org.adempiere.window.payment.validator.PaymentWindowValidator"/>
|
||||
<service>
|
||||
<provide interface="org.adempiere.webui.adwindow.validator.WindowValidator"/>
|
||||
</service>
|
||||
<property name="AD_Window_UU" type="String" value="ba895dc4-73df-4cf6-bc29-6dde6e011487"/>
|
||||
</scr:component>
|
|
@ -2,5 +2,6 @@ output.. = bin/
|
|||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
OSGI-INF/export.xml,\
|
||||
OSGI-INF/paymentwindowvalidator.xml,\
|
||||
OSGI-INF/
|
||||
source.. = src/
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
package org.adempiere.window.payment.validator;
|
||||
|
||||
import org.adempiere.util.Callback;
|
||||
import org.adempiere.webui.adwindow.validator.WindowValidator;
|
||||
import org.adempiere.webui.adwindow.validator.WindowValidatorEvent;
|
||||
import org.adempiere.webui.adwindow.validator.WindowValidatorEventType;
|
||||
import org.adempiere.webui.window.FDialog;
|
||||
|
||||
public class PaymentWindowValidator implements WindowValidator {
|
||||
|
||||
@Override
|
||||
public void onWindowEvent(WindowValidatorEvent event,
|
||||
Callback<Boolean> callback) {
|
||||
if (event.getName().equals(WindowValidatorEventType.BEFORE_PRINT.getName())) {
|
||||
FDialog.ask(event.getWindow().getADWindowContent().getWindowNo(),
|
||||
event.getWindow().getComponent(), "Print ?", callback);
|
||||
} else {
|
||||
callback.onCallback(Boolean.TRUE);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue