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;

An Example of Pre-Query and Post-Query Triggers in Oracle Forms With Using Display_Item to Highlight Dynamically的更多相关文章

  1. If Value Exists Then Query Else Allow Create New in Oracle Forms An Example

    An example given below for Oracle Forms, when a value exists then execute query for that value to di ...

  2. Freebie - Utility Form: Generate Excel Report From SQL Query In Oracle Forms 6i And 11g

    Sharing a form to generate Excel file report from SQL query in Oracle Forms. This form can be used i ...

  3. Elasticsearch 5.x 关于term query和match query的认识

    http://blog.csdn.net/yangwenbo214/article/details/54142786 一.基本情况 前言:term query和match query牵扯的东西比较多, ...

  4. Hibernate : Query.list()、Query.iterator()的区别

    Query上有list()与iterator()方法,两者的差别在于list()方法在读取数据时,并不会利用到快取,而是直接再向数据库查询,而iterator()则将读取到的数据写到快取,并于读取时再 ...

  5. Enter Query Mode Search Tricks Using Enter_Query Built-in in Oracle Forms

    In this post you will learn how to specify any condition in enter query mode of Oracle Forms. Whenev ...

  6. Create Data Block Based On From Clause Query In Oracle Forms

    Example is given below to create a data block based on From Clause query in Oracle Forms. The follow ...

  7. query.setFirstResult(0),query.setMaxResults(4)

    query.setFirstResult(0),query.setMaxResults(1);相当于MySQL中的limit 0, 1; String hql = "FROM Forum f ...

  8. 使用Retrofit时出现 java.lang.IllegalArgumentException: URL query string "t={type}&p={page}&size={count}" must not have replace block. For dynamic query parameters use @Query.异常原因

    /** * Created by leo on 16/4/30. */ public interface GanchaiService { @GET("digest?t={type}& ...

  9. dojo 学习笔记之dojo.query - query(id) 与query(class)的差别

    考虑这个样例:动态创建一个页面的时候,用new listtem()生成多个listitem, 且每一个listitem中都生成一个按钮button. 假设想要给每一个按钮都绑定一个click事件,用d ...

  10. Elasticsearch Query DSL备忘(1)(Constant score query和Bool Query)

    Query DSL (Domain Specific Language),基于json的查询方式 1.Constant score query,常量分值查询,目的就是返回指定的score,一般都结合f ...

随机推荐

  1. zw版【转发·台湾nvp系列Delphi例程】HALCON ObjToInteger1-4

    zw版[转发·台湾nvp系列Delphi例程]HALCON ObjToInteger1 procedure TForm1.Button1Click(Sender: TObject);var img, ...

  2. Eclipse安装插件支持jQuery智能提示

    Eclipse安装插件支持jQuery智能提示 最近工作中用到jQuery插件,需要安装eclipse插件才能支持jQuery智能提示,在网上搜索了一下,常用的有三个插件支持jQuery的智能提示:1 ...

  3. jquery ui和jquery easy ui的区别

    jquery ui 是jquery开发团队 开发,适用于网站式的页面.jquery easyui 是第三方基于jquery开发,适用于应用程序式的页面. 两者的方法调用也略有不同:jquery ui ...

  4. jQuery学习之prop和attr的区别

    1.attr() :默认保存的是浏览器的初始值  prop()保存的是更新的值 2.下面的是首用法,但是.attr()方法可以运行在所有的attributes情况下. 注意:一些DOM元素的prope ...

  5. SslUtil

    package com.eaju.util; import java.io.OutputStreamWriter;import java.net.URL;import java.net.URLConn ...

  6. 161025、java提高篇之关键字static

    一. static代表着什么 在Java中并不存在全局变量的概念,但是我们可以通过static来实现一个"伪全局"的概念,在Java中static表示"全局"或 ...

  7. linux源码Makefile详解(完整)【转】

    转自:http://www.cnblogs.com/Daniel-G/p/3286614.html 随着 Linux 操作系统的广泛应用,特别是 Linux 在嵌入式领域的发展,越来越多的人开始投身到 ...

  8. JavaEE基础(十五)/集合

    1.集合框架(对象数组的概述和使用) A:案例演示 需求:我有5个学生,请把这个5个学生的信息存储到数组中,并遍历数组,获取得到每一个学生信息. Student[] arr = new Student ...

  9. jquery中的节点的操作

    节点的操作 Dom 文档对象 模型 解决 一.插入节点 Append() 在每个匹配的元素中追加内容 Var  $li_1= “<li></li>”; Var  $li_2 = ...

  10. SlickGrid example 8:折线图

    根据数据生成折线图,使用相当简单,也很容易.     主要方法: 数据: var vals = [12,32,5,67,5,43,76,32,5]; 生成折线图: $("testid&quo ...