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

wfveoks0  于 2022-12-11  发布在  Oracle
关注(0)|答案(3)|浏览(139)

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.
Here is my code : I am using Oracle Forms 6i , WHEN_LIST_CHANGED Trigger ..

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 .

noj0wjuj

noj0wjuj1#

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.

py49o6xq

py49o6xq2#

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";

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;
e1xvtsh3

e1xvtsh33#

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.
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

相关问题