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

Get Oracle JDeveloper 11gR2 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.