简体   繁体   English

有人可以在 Apex 中解释这行代码吗

[英]Can someone explain this line of code in Apex

I'm very new to Oracle Apex and need help understanding this code I got from a tutorial on creating an app.我对 Oracle Apex 非常陌生,需要帮助理解我从创建应用程序的教程中获得的这段代码。 I've searched and I think it's JavaScript but I'm not even sure.我已经搜索过,我认为它是 JavaScript 但我什至不确定。

There is a page and there is a Modal Dialog.有一个页面,有一个模态对话框。 This code is supposed to refresh the page that the dialog is attached to once the dialog is closed.此代码应该在对话框关闭后刷新对话框附加到的页面。 In the Dialog section of the Modal Dialog, paste the following line in Attributes:在模态对话框的对话框部分中,在属性中粘贴以下行:

close: function(event, ui) {apex.navigation.dialog.close(true,{dialogPageId:&APP_PAGE_ID.});}

What is the close: part for?什么是close:部分? I know that function(..,..) declares a function in JavaScript.我知道function(..,..)在 JavaScript 中声明了一个 function。

I also found that apex.navigation.dialog.close(true) closes a dialog, but in this case the tutorial is saying that the user closed the dialog themselves and we're just detecting it so what's the point of this code?我还发现 apex.navigation.dialog.close(true) 关闭了一个对话框,但在这种情况下,教程是说用户自己关闭了对话框,我们只是检测到它,那么这段代码的意义何在?

Finally, I know that &APP_PAGE_ID.最后,我知道了&APP_PAGE_ID. is how you get the ID of a page in Apex but what is dialogPageId: written before it for?是如何在 Apex 中获取页面的 ID,但dialogPageId:在它之前写的是什么?

Link to tutorial 链接到教程

It's described in the docs .它在docs中有描述。 There is even an example of甚至还有一个例子

{dialogPageId:3})

-- from the docs: -- 来自文档:

This example demonstrates closing a modal dialog page, and returning an object of page item, dialogPageId and its value of 3. The returned value can be used by the page that launched the modal dialog, via a Dialog Closed Dynamic Action event, to identify the page ID of the modal dialog that triggered the event.此示例演示关闭模式对话框页面,并返回页面项的 object,dialogPageId 及其值为 3。启动模式对话框的页面可以通过 Dialog Closed Dynamic Action 事件使用返回的值来识别触发事件的模式对话框的页面 ID。

About the close: .关于close: Check the help text for the Dialog > Attributes section in the builder.检查构建器中对话框 > 属性部分的帮助文本。 It says:它说:

在此处输入图像描述

And in the jquery documentation that is mentioned you'll find a "close" event.在提到的 jquery 文档中,您会发现“关闭”事件。

So to summarize: The "close:" is a function that will be fired when the dialog is closed and in the function the dialog id of the closed dialog is set.总结一下:“关闭:”是一个 function,当对话框关闭时将被触发,并且在 function 中设置了关闭对话框的对话框 ID。

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

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