zoukankan      html  css  js  c++  java
  • An Example of Pre-Query and Post-Query Triggers in Oracle Forms With Using Display_Item to Highlight Dynamically

    Example is given for Pre-Query and Post-Query triggers in Oracle Forms, with using Display_Itembuilt-in in Post-Query triggers to highlight fields dynamically.
     
    This is the screen shot below for this example:
     

    You can also download this form from the following link: Query.fmb
     
    The example is based on HR schema departments table. In this example Department No. and Execute Query push button is in upper block named "Ctrl" block and below block is the departments block. User will be asked to enter department no. in above block and then to click on Execute Query button to filter the records below. The filtration is handled in Pre-Query trigger and after execution of query the Manager Name and Salary will be populated in Post-Query trigger by dynamically highlighting the Manager Name using Display_Item built-in.
     
    The following code written in Pre-Query trigger of Departments block to filter the records:
     
    if :ctrl.deptno is not null then
      -- set default_where property of the block to the ctrl block item to filter the records before query
      set_block_property('departments', default_where, 'department_id = :ctrl.deptno');
    end if;

    The following code written in Post-Query trigger of Departments block to populate non-database item fields and dynamically highlighting the Manager Name field:
     
    begin
     select first_name, salary into :departments.empname, :departments.sal
       from hr.employees where employee_id = :departments.manager_id;
       -- highlight as per your criteria
       if :sal >= 10000 then
                      -- create highlight visual attribute with color of your choice to highlight
          display_item('departments.empname', 'highlight');
       else
                     -- create default1 visual attribute to restore to normal view
          display_item('departments.empname', 'default1');
       end if;
    exception
     when others then
       null;
    end;

    The following code written in When-Button-Pressed trigger of Execute Query push button in Ctrl block to execute query in Departments block:
     
    go_block('departments');
    set_block_property('departments', default_where, '');
    execute_query;

  • 相关阅读:
    Atitit opencv3.0  3.1 3.2 新特性attilax总结
    Atitit html5.1 新特性attilax总结
    Atitit http2 新特性
    Atitit 大龄软件工程师的出路attilax总结
    Atitit 软件项目系统托盘图标解决方案
    Atitit js canvas的图像处理类库attilax总结与事业
    Atitit 切入一个领域的方法总结 attilax这里,机器学习为例子
    css知多少(8)——float上篇
    css知多少(7)——盒子模型
    css知多少(6)——选择器的优先级
  • 原文地址:https://www.cnblogs.com/quanweiru/p/6220262.html
Copyright © 2011-2022 走看看