如何在运行时更改按钮标签文本并添加新功能? Oracle表格 [英] How to change the push button label text and add a new functionality in runtime? Oracle Forms

查看:123
本文介绍了如何在运行时更改按钮标签文本并添加新功能? Oracle表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习Oracle Forms和Reports,这一次我想在按钮内编码一些功能.我添加了一个名为过滤器"的按钮,用于激活"enter_query"模式,以便在项目级别使用"WHEN-BUTTON-PRESSED"触发器添加一些搜索条件,并在该触发器中添加代码.编码太容易了:

I'm learning Oracle Forms and Reports, This time I would like to coding within a push button some functionalities. I've added a push button named "Filter" for active the "enter_query" mode to add some search criteria using "WHEN-BUTTON-PRESSED" trigger in item level and adding code within this trigger. It's too easy to code:

BEGIN 
  ENTER_QUERY; 
END; 

但是现在,我必须为此按钮添加两个新功能:

But now, I have to add two new functionalities to this button:

1-首先,当我编写一些搜索条件并按下名为"SEARCH"的第二个按钮以检索与之相关的数据后,"filter"按钮必须重命名为"LAST RECORD",如果我按"LAST RECORD"按钮表单应仅检索las搜索中检索到的最后一条记录.我考虑过应该如何解决此问题,并且尝试添加SET_ITEM_PROPERTY进行触发,但无法正常工作.

1- First, When I write some search criteria and after push in the second button named "SEARCH" to retrieve data relationated the button "filter" have to rename to "LAST RECORD" and if I press "LAST RECORD" button the form should to retrieve only the last record retrieved of the las search. I've think about how I should to resolve this problem and I've tried to add SET_ITEM_PROPERTY to trigger but it is not working correctly.

BEGIN 
   ENTER_QUERY; 
   SET_ITEM_PROPERTY('BLOCK_NAME', LABEL, 'LAST RECORD'); 
   LAST_RECORD;
END;

2-最后,在按"LAST RECORD"按钮后,应将其重命名为"CANCEL",如果再按一次此按钮,则应清除表格并在名为"FILTER"以启动新的搜索条件,次数取决于客户想要执行此操作的时间...

2- And finally, after press in "LAST RECORD" button, It should to rename to "CANCEL" and if I press in this button one more time it should to clear the form and start again in the first position named "FILTER" to start a new search criteria as many time as the client want to do it...

你有什么主意吗?谢谢.

Do you have any idea? Thanks.

推荐答案

您可以编辑此片段:

begin 
     if ( :system.mode = 'ENTER-QUERY' ) then
           set_item_property('b_search', label, 'search'); 
           go_block('blk_yours');
           execute_query;    
     else
           set_item_property('b_search', label, 'last record');         
           go_block('blk_yours');    
           enter_query;
     end if;    
           last_record;
end;

when-button-pressed 该项目的触发 b_search

这篇关于如何在运行时更改按钮标签文本并添加新功能? Oracle表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆