oracle 根据列表项的值启用/禁用项

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

Enable/Disable Item based on the value of the List Item

oracleoracleforms

提问by redsoxlost

I am trying to code a listItem which will have 2 values "New" and "Edit". I also have a search (Push Button) in the same canvas. I want to disable the Search button when I have selected "new" in the list item and enable it when "Edit" is selected in the list item.

我正在尝试编写一个 listItem,它将具有 2 个值“新建”和“编辑”。我在同一个画布中也有一个搜索(按钮)。我想在列表项中选择“新建”时禁用“搜索”按钮,并在列表项中选择“编辑”时启用它。

Here is my code : I am using Oracle Forms 6i , WHEN_LIST_CHANGED Trigger ..

这是我的代码:我正在使用 Oracle Forms 6i,WHEN_LIST_CHANGED 触发器..

begin
    if :CONTROL.LI_DO='New' then
          go_item('PB_SEARCH');
          SET_ITEM_PROPERTY('PB_SEARCH',enabled,property_false);
    else if :CONTROL.LI_DO='Edit' then
          go_item('PB_SEARCH');
          SET_ITEM_PROPERTY('PB_SEARCH',enabled,property_true);
    end if;
    end if;
end;

Any help is appreciated .

任何帮助表示赞赏。

回答by TenG

Been a while since I did forms, but can you disable an item that has current focus?

自从我做表格以来已经有一段时间了,但是您可以禁用当前具有焦点的项目吗?

I.e. navigate (GO_ITEM) to another item then try to disable PB_SEARCH.

即导航 (GO_ITEM) 到另一个项目,然后尝试禁用 PB_SEARCH。

回答by Barbaros ?zhan

LI_DO.Functional."Elements in List" : New (value 0), Edit (value 1);
LI_DO.Data."Data Type" : Number;
LI_DO."Initial Value" : 1;
LI_DO.Required : "Yes";

After those regulations, you may use the code below for "WHEN-LIST-CHANGED";

在这些规定之后,您可以使用下面的代码作为“WHEN-LIST-CHANGED”;

begin
    if :CONTROL.LI_DO = 0 then
        --go_item('PB_SEARCH');
          SET_ITEM_PROPERTY('PB_SEARCH',enabled,property_false);
    --else if :CONTROL.LI_DO = 1 then
    elsif :CONTROL.LI_DO = 1 then
        --go_item('PB_SEARCH');
          SET_ITEM_PROPERTY('PB_SEARCH',enabled,property_true);
    end if;
    --end if;
end;

回答by Amatu Allah

You have to know the concept of using enabled property. The following blog illustrate this with an example clears the point of misunderstanding of using 'enabled'property alone.

您必须了解使用 enabled 属性的概念。下面的博客通过一个例子说明了这一点,清除了单独使用“已启用”属性的误解点。

Pls. follow the solution steps you should be familiar with the four required properties in co-ordinate with each together to enable and disable an item

请。按照解决方案步骤您应该熟悉四个必需的属性,将每个属性协调在一起以启用和禁用项目