我试图在Adempiere中获取确认对话框。 我用过
JOptionPane.showConfirmDialog(null, msg,"", JOptionPane.YES_NO_OPTION);
or
ADialog.ask(WindowNo, null,msg)
instead of
mTab.fireDataStatusEEvent ("NoQtyAvailable", "0", true);
我获得了弹出窗口(是/否)并在Swing中正常工作但它不适用于WEBUI。
我的代码:
if (product.isStocked())
{
if (available == null)
available = Env.ZERO;
if (available.signum() == 0){
//mTab.fireDataStatusEEvent ("NoQtyAvailable", "0", false);
int response = JOptionPane.showConfirmDialog(null, msg,
"", JOptionPane.YES_NO_OPTION);
if (response == JOptionPane.YES_OPTION)
mTab.setValue("BC_Qty", mTab.getValue("QtyEntered"));
else
mTab.setValue("BC_Qty", Env.ZERO);
}
}
Buid ERROR:
Buildfile: E:\Adempiere360\svn\base\build.xml
init:
[echo] =========== Build Base
makedir:
compile:
[javac] E:\Adempiere360\svn\base\build.xml:56: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 1 source file to E:\Adempiere360\svn\base\build
[javac]
E:\Adempiere360\svn\base\src\org\compiere\model\CalloutOrder.java:27: package org.adempiere.webui.window does not exist
[javac] import org.adempiere.webui.window.FDialog;
[javac] ^
[javac]
E:\Adempiere360\svn\base\src\org\compiere\model\CalloutOrder.java:827: warning: [deprecation] getQtyAvailable(int,int,int,java.lang.String) in org.compiere.model.MStorage has been deprecated
[javac] BigDecimal available = MStorage.getQtyAvailable
[javac] ^
[javac]
E:\Adempiere360\svn\base\src\org\compiere\model\CalloutOrder.java:833: cannot find symbol
[javac] symbol : variable FDialog
[javac] location: class org.compiere.model.CalloutOrder
[javac] if(FDialog.ask(WindowNo, null, msg))
[javac] ^
[javac]
E:\Adempiere360\svn\base\src\org\compiere\model\CalloutOrder.java:1309: warning: [deprecation] getQtyAvailable(int,int,int,java.lang.String) in org.compiere.model.MStorage has been deprecated
[javac] BigDecimal available = MStorage.getQtyAvailable
[javac] ^
[javac] 2 errors
[javac] 2 warnings
BUILD FAILED
E:\Adempiere360\svn\base\build.xml:56: Compile failed; see the compiler error output for details.
Ay建议将不胜感激。
答案 0 :(得分:2)
ADempiere将按以下顺序构建代码
tools/build.xml
base/build.xml
extend/build.xml
client/build.xml
JasperReports/build.xml
serverRoot/build.xml
serverApps/build.xml
webStore/build.xml
webCM/build.xml
sqlj/build.xml
posterita/posterita/build.xml
zkwebui/build.xml
install/build.xml
' FDialog'课程在' zkwebui'中定义。夹。您已在CalloutOrder.java中使用了FDialog类(import org.adempiere.webui.window.FDialog;)。所以它(FDialog)在建立“基地”时是不可见的。文件夹中。
您只需从CalloutOrder.java类中删除import org.adempiere.webui.window.FDialog;
statemenet。
它将优化您的构建并在webUI中正常工作。
您可以从here
中找到构建订单详细信息答案 1 :(得分:1)
我已经编辑了你的病情。只需用以下条件替换现有条件:
if (product.isStocked())
{
if (available == null) {
available = Env.ZERO;
}
if (available.signum() == 0) {
//mTab.fireDataStatusEEvent ("NoQtyAvailable", "0", false);
boolean response = org.adempiere.webui.window.FDialog.ask(1,
null,"message1","Message 2");
if (response) {
mTab.setValue("BC_Qty", mTab.getValue("QtyEntered"));
} else {
mTab.setValue("BC_Qty", Env.ZERO);
}
}
}