APEX HTMLDB_APPLICATION与checkbox

The APEX HTMLDB_APPLICATION

The HTMLDB_APPLICATION package exposes several global variables used internally by the APEX engine.

  • g_user:  This is the ID of the currently logged in user.

  • g_flow_id:  This is the ID of the currently running application.

  •  g_flow_step_id:  This is the page ID for the currently running application page.

  • g_flow_owner:  This is the parsing schema for the current application.

  • g_request:  This is the most recent REQUEST.  Requests are set by buttons in APEX.

The HTMLDB_APPLICATION package also exposes a global array which references values from certain page items.  The HTMLDB_ITEM package can be used to create items on an application page.  This means the developer creates them programmatically during page rendering instead of creating the page item with a wizard.  When items are created like this, they are provided a numeric value.  APEX then references the page item in an array.  Up to 50 items can be created using the HTMLDB_ITEM package and still be allowed to reference them using HTMLDB_APPLICATION package.  An example of this was provided during the checkbox explanation in an earlier chapter of this book.  There, the htmldb_item.checkbox procedure was used to add checkboxes to a report.  The arrays in the htmldb_application package were then used to reference the checkbox during page processing.

For the checkboxes shown in Figure 10.3, the HTML code that was rendered by using the htmldb_item.checkbox procedure looks like the following:

<input type="checkbox" name="f10" value="1" CHECKED />
<input type="checkbox" name="f10" value="2" CHECKED />
<input type="checkbox" name="f10" value="3" />
<input type="checkbox" name="f10" value="4" CHECKED />
<input type="checkbox" name="f10" value="5" />

When the page is submitted, only the checkboxes which are checked will appear in the arrays of the htmldb_application package.  For the example above, there will be three array elements in the array named g_f10.  Programmatically, it is possible to loop through the array in a page processing process and update the data in the database.  The following code shows an example of how the code to loop through the htmldb_application.g_f10 array would look:

begin
  for i in 1..htmldb_application.g_f10.count loop
    update class
    set    available_flag = 'Y'
    where  class_id = htmldb_application.g_f10(i);
  end loop;
end;

While looping through the array and using the sample checkboxes from above, the values one, two, and four would appear in the array.

转载自:

http://www.dba-oracle.com/t_easy_html_db_application.htm



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值