如何使用 PLSQL 在 Oracle Apex 中设置复选框的状态?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6179859/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 23:50:11  来源:igfitidea点击:

How to set status of a check box in Oracle Apex using PLSQL?

oracleoracle-apex

提问by macwadu

How can I set a value of a check box after submit?

提交后如何设置复选框的值?

I clicked the check box and when I click in the submit button, it deselects.

我点击了复选框,当我点击提交按钮时,它取消选择。

回答by Tony Andrews

Having looked at the example you linked to in a comment above, I think your checkbox item is not set up correctly. Looking at the URL in the browser after checking the checkbox and pressing the Apply button I see:

查看您在上面的评论中链接到的示例后,我认为您的复选框项目设置不正确。在选中复选框并按下应用按钮后查看浏览器中的 URL,我看到:

http://apex.oracle.com/pls/apex/f?p=17236:555:3681260444833458::NO::P555_CHECK:

That explicitly sets the values of the checkbox item to NULL, which is normally the unchecked value. As an experiment I changed the URL to:

这将复选框项的值显式设置为 NULL,这通常是未选中的值。作为实验,我将 URL 更改为:

http://apex.oracle.com/pls/apex/f?p=17236:555:3681260444833458::NO::P555_CHECK:Y

The page reloaded with two checkboxes!:

页面重新加载了两个复选框!:

two checkboxes

两个复选框

So how is your checkbox item defined? It should be defined something like this: enter image description here

那么你的复选框项目是如何定义的?它应该像这样定义: 在此处输入图片说明

i.e.

IE

  • the number of checkbox columns should be 1
  • "display extra values" and "display null values" should both be set to No
  • the list of values should only specify the checked value (I have used 'Y'). This can be done via a named LOV rather than the way I have done it.
  • 复选框列数应为 1
  • “显示额外值”和“显示空值”都应设置为否
  • 值列表应仅指定选中的值(我使用了“Y”)。这可以通过命名的 LOV 来完成,而不是我这样做的方式。

Also, you don't want to reset P555_CHECK to null in the page branch.

此外,您不想在页面分支中将 P555​​_CHECK 重置为 null。