带有 [行选择器] 的 APEX 表格表单:如何在提交时设置所选行中的列值
我有一个表格,显示所有提交处理的请求。提交者有机会随时取消请求。我希望通过简单地选中应取消的行的行选择器复选框并单击提交来完成此操作。
好的...我试图创建的是一个表格表单,当选中 [行选择器] 复选框并提交表单时,该行的“状态”列中的值将设置为“已取消”。
由于存在 [行选择器] 复选框,我猜测可能存在某种内置进程,可以识别所选行并对所选行运行操作。
有没有办法利用此功能并采取额外的步骤将行的“状态”列的值设置为“已取消”?
I have a tabular form that displays all requests submitted for processing. Submitters have the opportunity to cancel requests at any time. I would like this to be accomplished by simply checking the row selector checkbox of the row(s) that should be cancelled and clicking submit.
Ok... What I am trying to create is a tabular form that, when the [row selector] checkbox is checked and the form is submitted, the value in the 'Status' column of the row is set as 'Cancelled'.
Since the [row selector] checkboxes exist, my guess is there is probably a built in process of some sort that identifies the selected rows and runs an action on the selected rows.
Is there a way to tap into this functionality and take the extra step to set the value of the 'Status' column of the row to 'Cancelled'?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
阅读我对汤姆的回答的评论。流程示例代码:
Read my comment on Tom's answer. Example code of process:
通常,添加的行选择器将存储在
apex_application.g_f01
数组中(有关这些数组的更多信息,请参阅 apex api 文档)。通过查看页面的 html 输出来验证这一点。在表格形式 html 之后,您可以找到数组映射的输入(我使用基于EMP
表的表格形式):您将需要行选择器(数组 f01)以及您认为的任何其他值你会需要的。
例如,我使用数组 3:
ENAME
。在我的表格中,我转到第 2 页并选择了 2 名员工。
这在我的调试中输出为:
请注意,行选择器值是报告当前页面的行号。
如果需要更新状态,则需要引用一个保存记录 ID 的数组。这样您就可以对这些记录执行
UPDATE
。Normally, the added row selector will be stored in the
apex_application.g_f01
array (more info on those arrays, see the apex api doc). Verify this by looking at your html output of your page. After your tabular form html you can find the input to array mapping (i used a tabular form based on theEMP
table):You will need the row selector (array f01), and any other value you think you'll need.
For example, i used array 3:
ENAME
.On my tabular form, i went to page 2 and selected 2 employees.
This outputs in my debug to:
Take note that the row selector value is the rownumber for the current page of the report.
If you need to update a status, you'll need to reference an array which holds the ID for a record. This way you'll be able to perform an
UPDATE
on those records.