Skip to topic | Skip to bottom
Home
You are here: TWiki > Apex Web > QuickTipsCategory r14 - 23 Apr 2007 - 04:36 - ColinSheppard


Start of topic | Skip to actions

Quick Tips!

These are some quick tips for Apex

Processes

Any 'On Load: Before Header (page template header)' should have a Conditional Processing PL\SQL Expression like:

:APP_PAGE_ID NOT IN (101)
AND :SAMPLE_APP_ITEM_1 IS NULL

The number '101' refers to the login page. Most likely there is activity you do not want executed until after the user has successfully logged in. For example you might want to refresh some global variable/application item values due to risks that the value may not persist (e.g. current session data like time zone).

Author: Colin Sheppard - 10 Jan 2006

Use PL/SQL Regions

If you are having many HTML DB Items on a page, consider using a PL/SQL Dynamic Content Region or a PL/SQL Process anywhere on that page.

(This very page was once a large collection of HTML DB Items, until it was redesigned into what it is now, just one PL/SQL Dynamic Content Region that does not really require any Items at all. All you need to do is to use htp.p carefully.)

Source: http://forums.oracle.com/forums/message.jspa?messageID=1093033#1093067

Author: Colin Sheppard

Tracing performance problems

If you are trying to track down a performance problem in your application, you can enable tracing by simply -

  • Appending &p_trace=YES to the URL of your page and re-executing it.
  • Check the user_dest_dump directory on the database server for the trace file

You can then run the trace file through TKProf to examine what was actually performed by your page.

Note: This will only work for applications with a build status of "Run and Build Application", to prevent tracing in your application set the status to "Run Application Only"

Author: JohnScott 05 Dec 2005

Unconditional branches

If you have a unconditional branch back to the same page, make sure the sequence number of the branch is some very high number like 999.

This will ensure that when you add more features to the page and they create their own conditional branches, the unconditional branch is not fired "by accident". Things like this can be very difficult to figure out.

Author: Vikas A

Clear popup key LOV item

The way the Popup Key LOV item works is that the text field is disabled so that user cannot type in a value, they have to select a value from the popup LOV window. This is fine, but once a value is selected from the popup window, there is no way to "clear" or blank out the value since the text field is non-editable.

To get around this, add the following to the Post Element text box for the Popup Key LOV item

<img src="#IMAGE_PREFIX#delete.gif" onClick="document.getElementById('#CURRENT_ITEM_NAME#_HIDDENVALUE').value='';
document.getElementById('#CURRENT_ITEM_NAME#').value=''"
/>

This adds a little X icon next to the popup lov icon to clear out the item.

-- VikasA - 06 Jan 2006

Conditional Display of Elements based on Validation Error

There is a built-in condition that can be used to show/suppress display elements based on whether validation errors are being shown. These conditions are named 'Inline Validation Errors Displayed' and 'No Inline Validation Errors Displayed'.

Source: http://forums.oracle.com/forums/message.jspa?messageID=878522#878522

Author: Colin Sheppard - 09 Jan 2006

Conditional Processing for Requests

There is a condition type on the conditional processing which is:

Request is Contained within Expression 1

which maybe more desireable to use over:

Request = Expression 1

It allows you to use multiple choices of the request, for example where Expression 1:

'SAVE', 'CREATE'

Author: Colin Sheppard - 10 Jan 2006

One login for multiple applications

To require only one login whilst referring to many applications ensure that you provide a session ID (&SESSION.) in any link to a page that requires authentication, even if you're already authenticated, otherwise you'll have to login again. For example:

f?p=app:page:&SESSION.::NO::ITEM:value 

Source: http://forums.oracle.com/forums/thread.jspa?threadID=327658&tstart=0

Author: Colin Sheppard - 10 Jan 2006

Inside Apex!

If you ever wondered how some functionality or look-n-feel was implemented within the Apex applications themselves (Application Builder, SQL Workshop or Administration), these are nothing but Apex applications themselves with "source code" available in the distribution.

Source: Forum link

-- VikasA - 04 Feb 2006

Radio Group

Under Element, enter the following in 'Form Element Option Attribute':

class="instructiontext"
This specifies that the text associated with each radio group option is the same size as other items on the page.

-- ColinSheppard - 12 Jun 2006

Pagination

Resetting pagination is just the process of setting a pagination-enabled report back to page 1.

Source: Fourm Link

Pagination refers to the methods available for the user to navigate through a result set of a query (report) when the entire set is not sent to the browser in any given request.

BTW, there are 116 references to "pagination" in the 1.6 User's Guide. Only eight are preceded by an adjective, although they all could be, as "pagination" and "report pagination" are synonymous.

Source: http://forums.oracle.com/forums/thread.jspa?messageID=934703&#934703

-- ColinSheppard - 12 Jun 2006

Wrap the List of Values

If you have a complicated list of values like:

SELECT org.short_name || ' - ' || cat.cat_2_short as d, org.organization_id as r
  FROM organization org,
       cat_consumer_activity cat
 WHERE org.organization_id = cat.organization_id
ORDER BY r

It may result in:

LOV query is invalid, a display and a return value are needed, the column names need to be different. 
If your query contains an in-line query, the first FROM clause in the SQL statement must not belong 
to the in-line query.

To correct this wrap the query as follows, such that the query follows the FROM statement in brackets():

SELECT d, r
  FROM (SELECT org.short_name || ' - ' || cat.cat_2_short as d, org.organization_id as r
          FROM organization org,
               cat_consumer_activity cat
         WHERE org.organization_id = cat.organization_id
      ORDER BY r)

Also, it is elegant in that it looks unambiguous and works that way.

-- ColinSheppard - 4 Jul 2006

Apex Applicaitions Available from local server and remote clients (Oracle XE)

In Oracle XE, if you want your Apex applications available to others on your LAN or even the Internet you need to specify "Available from local server and remote clients". This can be found in a setting called “Manage HTTP Access” under the Administration section of APEX.

Source: Eddie Awad's Blog : http://awads.net/wp/2006/04/03/i-use-oracle-database-10g-express-edition-to

-- ColinSheppard - 23 Apr 2007

Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r14 < r13 < r12 < r11 < r10 | More topic actions
This site is powered by the TWiki collaboration platformCopyright © 1999-2010 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback