Using findAndSetCurrentRowByKey() to set the view object currency
You can set the currency on a view object by calling its findAndSetCurrentRowByKey()
method. The method accepts two arguments: a Key
object that is used to locate the row in the view object, and an integer indicating the range position of the row (for view objects configured with range paging access mode).
This recipe demonstrates how to set the view object row currency by implementing a helper method called refreshView()
. In it we first save the view object currency, re-query the view object and finally restore its currency to the original row before the re-query. This has the effect of refreshing the view object while keeping the current row.
Getting ready
You will need to have access to the shared components workspace that was developed in the Breaking up the application in multiple workspaces recipe in Chapter 1, Pre-requisites to Success: ADF Project Setup and Foundations. The functionality will be added to the ExtViewObjectImpl...