简体   繁体   English

在Adempiere的Model类内添加确认(是/否)对话框

[英]Add confirm (Yes /No) dialog box inside Model class in Adempiere

I want to create confirm dialog box inside Model class. 我想在Model类中创建确认对话框。 I created window which has several text boxes and after entering the values user can save data. 我创建了一个具有多个文本框的窗口,输入值后,用户可以保存数据。 At the point of saving data I want to add a confirm dialog box asking "Are you sure to save these data ?" 在保存数据时,我想添加一个确认对话框,询问“您确定要保存这些数据吗?” So inside Model class I tried to put 所以在Model类中,我尝试放入

org.adempiere.webui.window.FDialog.ask(1,null,"Are you sure to save these data ?");

When I add this into my code, it will give errors and I can't build the project. 当我将其添加到我的代码中时,它将给出错误,并且我无法构建项目。

If anyone knows how to add confirm dialog box in model class? 如果有人知道如何在模型类中添加确认对话框? Please help me to do this... 请帮我做到这一点...

In Adempiere For Swing Class (ie) model class you can use by below 在Adempiere Swing类(即)模型类中,您可以在下面使用

 int response = JOptionPane.showConfirmDialog(null, Are you sure to save these data ?
                            "", JOptionPane.YES_NO_OPTION);
 if (response == JOptionPane.YES_OPTION) 
   ;                    
 else
   ;                  

or Adialog in Client modules cann't used in Base modules 客户端模块中的“或”对话框无法在基本模块中使用

ADialog.ask(WindowNo, null,"Are you sure to save these data ?");

FDialog Should be used only in ZKWebui package, never use zk classes in base/client modules FDialog应该仅在ZKWebui软件包中使用,切勿在基本/客户端模块中使用zk类

org.adempiere.webui.window.FDialog.ask(1,null,"Are you sure to save these data ?")

In window/tab before save you can use " Commit Warning " column in Window,Tab & field (Application Dictionary) 保存前在窗口/选项卡中,可以在窗口,选项卡和字段(应用程序词典)中使用“ 提交警告 ”列

Hope it will helps you. 希望对您有帮助。

You can use JOptionPane but not ADialog or FDialog. 您可以使用JOptionPane但不能使用ADialog或FDialog。 Usage of ADialog throws build error. 使用ADialog会引发生成错误。 As its is defined in client folder, you cant use it in the upper hierarchy. 由于它是在客户端文件夹中定义的,因此不能在上层结构中使用它。

You can find the build order from here 您可以从这里找到构建顺序

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM