Oracle 表单:如何通过切换单选按钮禁用/启用表单中的某些块或字段?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10488384/
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
Oracle form: How to disable/enable certain blocks or fields in form by switching radio buttons?
提问by Jestem_z_Kozanowa
I have three radio buttons in my Oracle form. Ideally, selecting one option would enable block1 and disable block2 and block3. How this could be achieved? Global variable? Which trigger 'listen' to changes of radio button?
我的 Oracle 表单中有三个单选按钮。理想情况下,选择一个选项将启用块 1 并禁用块 2 和块 3。这是如何实现的?全局变量?哪个触发器“监听”单选按钮的变化?
DB is Oracle6i.
DB是Oracle6i。
Any help greatly appreciated.
非常感谢任何帮助。
采纳答案by DCookie
Look into the WHEN-RADIO-CHANGED trigger.
查看 WHEN-RADIO-CHANGED 触发器。
If you've got radio buttons already defined for your form, you know that a radio group is the field you define on your form, and you can define as many radio buttons for a group as desired. Each radio button is associated with a specific value when you build the form.
如果您已经为表单定义了单选按钮,您就知道单选组是您在表单上定义的字段,您可以根据需要为组定义任意数量的单选按钮。当您构建表单时,每个单选按钮都与一个特定的值相关联。
When one of the radio buttons in a radio group is changed/selected, the when-radio-changed trigger will fire. At that point, depending on which button was pressed, you'll have a value for the radio group. Perform your desired action for the button pressed. So, a skeletal PL/SQL structure to implement this in your trigger could be:
当无线电组中的单选按钮之一被更改/选择时,无线电更改时触发器将触发。那时,根据按下的按钮,您将获得无线电组的值。对按下的按钮执行所需的操作。因此,在触发器中实现这一点的骨架 PL/SQL 结构可能是:
IF :radio_group = '1' THEN
-- enable/disable as many properties as desired for the blocks
SET_BLOCK_PROPERTY('block1',property_to_enable,PROPERTY_TRUE);
SET_BLOCK_PROPERTY('block2',property_to_disable,PROPERTY_FALSE);
SET_BLOCK_PROPERTY('block3',property_to_disable,PROPERTY_FALSE);
ELSIF :radio_group = '2' THEN
...
ELSIF :radio_group = '3' THEN
...
END IF;