根据Oracle APEX 4.0中的项目更改页面标题 [英] Change page title based on item in Oracle APEX 4.0

查看:181
本文介绍了根据Oracle APEX 4.0中的项目更改页面标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Oracle APEX 4.0中,我有一个客户数据库,我希望页面标题更改为我选择编辑的客户名称.我这样输入标题: http://i.stack.imgur.com/Bo0cy.png

In Oracle APEX 4.0, I have a database of customers and I would like the page title to change to the name of the customer I selected to edit. I entered the title like this: http://i.stack.imgur.com/Bo0cy.png

但是,选项卡如下所示: http://i.stack.imgur.com/Z41H4.jpg

However, the tab comes out like this: http://i.stack.imgur.com/Z41H4.jpg

我做错了什么?

推荐答案

使用替换字符串设置变量Apex页面属性

此解决方案是在 Oracle Corp.在apex.oracle.com上托管的系统上开发的,其中APEX(Oracle Application Express)版本当前为4.2.5.尽管OP要求提供4.0版的建议,但自Apex的最新3.x版本一直到现在,所要求的功能都是可能的.

This solution was developed on a system hosted by Oracle Corp. at apex.oracle.com, where the APEX (Oracle Application Express) version is currently 4.2.5. Although the OP is requesting advice for release 4.0, the functionality requested has been possible since the late 3.x versions of Apex through to the present.

此解决方案使用替换字符串 .替换字符串可以引用任何应用程序项或页面项.任何以&开头(& ;;),以点(.)结束并在它们之间包含项目名称(以所有大写字母表示)的字符串都将被解释为替换字符串,并由该值替换为当前会话/上下文.

This solution uses substitution strings. Any application item or page item can be referenced by a substitution string. Any string that begins with an ampersand (&), ends with a dot (.), and contains an item's name (in all capital letters) between them will be interpreted as a substitution string and will be replaced by the item's value in the current session/context.

这很有用,因为可以通过PL/SQL代码,SQL查询和用户输入来操纵所引用项目的值.

This is useful because the value of the referenced item can be manipulated through PL/SQL code, SQL queries, and user input.

您可以使用替换字符串引用页面项目PX_SAMPLE_ITEM &PX_SAMPLE_ITEM..

You can refer to a page item PX_SAMPLE_ITEM with the substitution string &PX_SAMPLE_ITEM..

请务必注意,末尾的点是必需的.

It is important to note that the dot at the end is necessary.

在这里可以设置可变应用程序ITEM(页面标题属性):

This is one place where a variable application ITEM can be set (Page Title Attribute):

以下是我使用页面级项目的几个屏幕快照,页面级项目定义为变量SELECT LIST表单元素.选择列表项还设置了REDIRECT属性,以便每次选择或更改新值时,页面将自动刷新和更新页面标题属性.

The following are a couple of screenshots where I used a page-level item, defined as a variable SELECT LIST form element. The select list item also had a REDIRECT property set so that the page would automatically refresh and update the page title property each time a new value was selected or altered.

如果您在创建页面及其内容时从第一遍开始就无法正常工作,请汇总以下设置以验证:

If you have any difficulty getting things to work from the first pass when creating the page and its contents, this a summary of the settings to verify:

  1. 请注意,在应用程序视图中,PAGE 11是包含我的可变页面标题值示例的页面.
  1. Note that within the view of the application, PAGE 11 is the page which contains my example of a variable page title value.

  1. 深入到第11页的布局属性.P11_PAGE_TITLE是存储桶,其中包含您希望页面标题成为的内容.这可以是静态定义,也可以是用户选择的结果,等等.请确保创建此项目,并在页面标题定义部分中引用它时使用相同的名称(在下面的部分/步骤3中突出显示)
  1. Drill down to the layout properties of page 11. P11_PAGE_TITLE is the bucket that contains whatever you want the page title to be. This can be a static definition, the result of a user selection, etc. Make sure to create this item and use the same name when referencing it within your page title definition section (highlighted in section/step 3 below)

  1. 注意圈出的区域.这些是需要定义/引用上面第2步中提到的页面项目的字段.第一个字段页面名称"不如第二个字段重要,后者是页面显示"属性的一部分.我填写了两者,但您可能只需要后者.

打开Display Attributes > Title属性的项目帮助文本时,内联文档说,TITLE字段中插入的所有内容均位于呈现的页面HTML代码的<TITLE></TITLE>块内:

Opening the item help-text for the Display Attributes > Title property, the inline documentation says that whatever is inserted into the TITLE field is put inside the <TITLE></TITLE> block of the rendered page HTML code:

我无法确定确切的版本,该方法仍然可以像上面详细说明的那样工作.为了回应OP作者@MNT关于保持其实例及其Apex版本最新的意见,我在下面做了一些说明.

I cannot speak for sure on the exact version where this approach still works as detailed above. I made a few notes below in response to comments from @MNT, the OP author with respect to keeping their instance and its version of Apex up to date.

@MNT没问题,我提到在4.25(我的解决方案)和4.00(您的版本)中尝试的方法之间可能的兼容性,但是请记住,这些版本之间的时间间隔可能超过两年,并且后端数据库版本(Oracle 10g到Oracle 11g R1 ...甚至11g R2)之间也发生了跳跃.我想这不是您所能保证的,但是请考虑升级.所有APEX补丁程序和发行版升级都是免费的,保持更新非常重要.

No problem @MNT, I mentioned possible compatibility between the method tried in 4.25 (my solution) and 4.00 (your version), but keep in mind, the gap in time between these versions is probably more than two years of upgrades and also a jump between backend databases versions (Oracle 10g to Oracle 11g R1... and even 11g R2) Lots has happened. I suppose that isn't very assuring from your situation, but consider upgrading. All APEX patch and release upgrades are free and it's important to keep up.

为什么保持升级和补丁集很重要(示例) 仅从4.20到4.25的跳数(根据我的经验)是一个艰巨的尝试,因为实际的内部列已删除,索引键也消失了……这使我导出的脚本存储库无用.确保您为此类活动留出后门或完善的升级计划(如果您有现有的应用程序).升级后,实际上再也没有回去了:(

Why It's important to keep up your upgrades and patch sets (an example) The hop from 4.20 to 4.25 alone (from my experience) was an arduous one as actual internal columns were dropped and index keys disappeared... rendering my repository of exported scripts useless. Make sure you leave yourself a back door or a sound upgrade plan (if you have existing applications) for that kind of event. Once you upgrade, there really is no going back :(

这篇关于根据Oracle APEX 4.0中的项目更改页面标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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