Salesforce

Recycled Frames (Magic xpa 4.x)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

Recycled Frames (Magic xpa 4.x)

One way to avoid opening multiple windows is to display each window on top of the previous window. This method is based on the browser-client capability to override an existing browser task within a frame by another browser task. You can do this by creating a dispatcher browser task that handles all required tasks.

The Dispatcher Task

The dispatcher task is a virtual task that provides no real interface and serves as a module that switches among its descendant tasks.

Although a dispatcher requires no interface, there must be at least one virtual field that is a parkable field. Using styles, this field can be set so it will not appear.

Things you need to know about a dispatcher task:

  • An IFRAME control – The dispatcher task HTML page should include an IFRAME control, which is used to display the actual tasks.

  • Switching tasks – The dispatcher task should include handlers that are activated from each descendant task. These handlers execute a Call operation for the next task that replaces the current running task in the IFRAME. The destination of the Call operation should point to the IFRAME on the page.

  • Calling the first task – The first task to be displayed can be called from either the Task Prefix handler of the dispatcher task or the Record Prefix handler

The Called Tasks

Each task, except the last task that is displayed in the dispatcher frame, should call the next task. This is not done by a direct Call operation to the task but by raising an event to be handled by a dispatcher task handler, which in turn calls the task needed to replace the current task, as shown in the figure below. In this way, the current task will be properly closed.

Tip:

This mechanism works for calling the previous task in the same way that it works for calling the next task.

Transactions

The instructions below can help you to determine the necessary settings for the task transaction modes.

Single transaction for all tasks

If you wish to set a single transaction for all the participating tasks, set the transaction mode of the dispatcher task to Nested Deferred, and set the transaction mode of each descendant task to Deferred.

If the dispatcher task is called from a task that already opened a transaction and you want the dispatcher task transaction and its participating tasks to be part of the parent transaction, you should set the dispatcher task transaction mode to Deferred.

Independent transaction for each task

If you want each task to have an independent transaction that will be committed when the task is replaced by the next task, set the dispatcher task transaction mode to None, and set the transaction mode of each descendant task to Deferred.

Sample Application:

The Customer Orders II option demonstrates the recycled frame mechanism.

Reference
Attachment 
Attachment