如何在 Oracle Forms Builder 中显示对话框画布?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13437837/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I display a dialog canvas in Oracle Forms Builder?
提问by Ahmad
I have built a form in which the user can view multiple rows of data pulled from a table. The user has the option to select a row, then pressing a button to reject the data in that row, (to be marked as rejected in some STATUS field).
我构建了一个表单,用户可以在其中查看从表中提取的多行数据。用户可以选择一行,然后按下按钮拒绝该行中的数据(在某些状态字段中标记为拒绝)。
I have also designed a rejection confirmation dialog with the ability for the user to enter some comments or reason for rejection.
我还设计了一个拒绝确认对话框,用户可以输入一些评论或拒绝原因。
I have set up the dialog canvas to appear on its own window with the Type proeperty set to Dialog.
我已将对话框画布设置为显示在其自己的窗口中,并将类型属性设置为对话框。
When the user selects a row to reject, here is the code that gets executed:
当用户选择要拒绝的行时,以下是执行的代码:
BEGIN
GO_BLOCK('BLK_ALL_RECORDS');
FIRST_RECORD;
IF :FRM_ALL_ROWS.CHK_SELECT = 1 THEN
:FRM_REJECTION.ID := :FRM_ALL_ROWS.ID;
GO_BLOCK('BLK_REJECTION');
SHOW_VIEW('CNV_REJECTION');
EXIT;
ELSE
NEXT_RECORD;
END IF;
END;
And the rejection form has two buttons, one to confirm and one to cancel. Let's just focus on the cancel button for now. Here is the code that is executed once the Cancel button is pressed:
并且拒绝表单有两个按钮,一个是确认,一个是取消。现在让我们只关注取消按钮。这是按下取消按钮后执行的代码:
:BLK_ALL_ROWS.CHK_SELECT := 0; /* Forces removal of the check mark */
GO_BLOCK('BLK_ALL_RECORDS');
HIDE_VIEW('CNV_REJECTION');
The only problem is : once the dialog form appears, it hides the parent form, until the form is dismissed. How can display the dialog form ontop of the parent form with both of them visible (in a modal way?)
唯一的问题是:对话框窗体出现后,它会隐藏父窗体,直到窗体被关闭。如何在父窗体上显示对话框窗体,并且它们都可见(以模态方式?)
采纳答案by Ahmad
I found out what was the problem finally.
The parent Window had a property [Hide On Exit
] which is defaulted to Yes
and that made the parent form disappear everytime another window is on display. I set it to NO
and called the other form. This time both windows are visible, with the modal one always on top.
我终于知道是什么问题了。父 Window 有一个属性 [ Hide On Exit
] ,该属性默认为Yes
并且每次显示另一个窗口时父窗体都会消失。我将其设置为NO
并调用了另一种形式。这次两个窗口都是可见的,模态窗口总是在顶部。
回答by DJPeter
The navigation between different canvases can be little bit tricky to get to work. Hard to say what is the problem with not having the form in front of me but the first thing I should do is making sure that the 'Raise on entry' canvas property of the 'main' canvas is set to 'Yes'. This should force this canvas to be displayed when you are moving the cursor back to block 'BLK_ALL_RECORDS'.
不同画布之间的导航开始工作可能有点棘手。很难说没有表格在我面前有什么问题,但我应该做的第一件事是确保“主”画布的“进入时提高”画布属性设置为“是”。当您将光标移回块“BLK_ALL_RECORDS”时,这将强制显示此画布。
Another alternative could be to use SHOW_VIEW() in the cancel dialog logic to force the main canvas to be displayed.
另一种替代方法是在取消对话框逻辑中使用 SHOW_VIEW() 来强制显示主画布。