How to set the browser window/tab title for Oracle Forms application
Posted by xtrailrunner on July 22, 2008
When running a Forms application in the browser you normally find Oracle Application Server Forms Services as the title of the browser window or if you use IE 7 or Firefox as the title of the active tab.
This title is set in the file formsweb.cfg and can be changed but it remains a piece of static text.
What if you would like to see something more meaningful like the module name, the user name or something similar ?
Here are the steps to implement it:
- Modify the base template (for example basejini.html) you are using by adding a JavaScript function
<script>
function change_pagetitle(title)
{
document.title=title;
}
</script> - In every form define a trigger after startup (PRE-FORM, WHEN-NEW-FORM-INSTANCE) with the following call:
web.show_document(‘javascript:change_pagetitle(‘||’”‘ || get_application_property(current_form_name) || ‘”‘||’) ‘ ,’_self’)
In this example the name of the running form will be displayed but you can define other properties too.
With Oracle Forms 11g perhaps there is a more simple solution based on the new JavaScript API. Let’s see.