Menu

TkOAControllerImpl

Barry Goodsell

TkOAControllerImpl

Package com.oaframework.toolkit.common.webui
Extends oracle.apps.fnd.framework.webui.OAControllerImpl

This class provides functionality in two key areas:

  • support for Datetrack-aware applications
  • simple cover methods for the TransactionHelper class

See the Example for an example of how to use the Transaction Helper methods.

processRequest()

Cover for the standard processRequest() method. This version will ensure that the Session Date is set for [DateTrack] applications

processFormRequest()

Cover for the standard processFormRequest() method. Currently add no extra functionality.

getAppModule()

Returns the current Application Module, cast to a TkOAApplicationModuleImpl

setSessionDate()

Three overloaded methods that set the supplied date as the Session Date.

setSessionDate(OAPageContext pageContext, OAWebBean webBean, Date sessionDate)

Sets the supplied {{JboDomain|Date}} as the AM Session Date and the Database Session Date (in FND_SESSIONS).

setSessionDate(OAPageContext pageContext, OAWebBean webBean, String sessionDate)

Converts the String Date (format dd-mm-YYYY) to a Date then sets the Session Dates as above.

setSessionDate(OAPageContext pageContext, OAWebBean webBean)

Gets the Session Date from the Transaction Value, or Database SYSDATE if the Transaction Value is not defined. Then sets the Sessions Dates as above.

resetSessionDate()

Sets the Sessions Dates to Database SYSDATE, as above.

startTransaction()

Cover onto TransactionUnitHelper.startTransactionUnit()

endTransaction()

Cover onto TransactionUnitHelper.endTransactionUnit()

isTransactionInProgress()

Cover onto TransactionUnitHelper.isTransactionUnitInProgress()

checkTransaction()

Calls isTransactionInProgress() to see if the named transaction is in progress. If it is, a further check is made to determine whether the Browser Back was used. If it was a "Navigation Error" exception is raised; otherwise a "Failover State Loss Error" exception is raised.

Example

The TransactionHelper methods are useful when you have a number of different screens in your system, some for displaying data, others for maintaining that data. For this example, suppose we have one Page that lists all the values from a given table (ListRecordsPG), displayed using an AdvancedTable region. Our other Page is for creating or updating a single record from that same table (MaintainRecordsPG), displayed using a MessageComponentLayout. However, for this example we will just concentrate on the creation of records.

The Controller for ListRecordsPG (ListRecordsCO) handles an User Interface event that corresponds to the User having clicked on the "Create" button. Before navigating to the MaintainRecordsPG, the startTransaction() method is called, passing in a suitable name for the transaction, eg: CREATE_RECORD. It is recommended that the constants for the Transaction Names are held in a common constants class.

In the Controller for the maintenance Page (MaintainRecordsCO) the processRequest() method will need to call checkTransaction() with the same constant to check whether the Transaction is in process. Likewise, the processFormRequest() method will need to end the transaction by calling endTransaction() when the user navigates back to ListRecordPG, either by saving or cancelling the edits.


Related

Wiki: DateTrack
Wiki: com.oaframework.toolkit.common.webui

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.