Weblog

JBO-25020 errors when using setCurrentRowWithKey

In ADF (in combination with ADF Business Components) you can use setCurrentRowWithKey to specify which record should be active. This is often used when selecting one record from a table of results, after which you want to display a page with the details of the selected record.

If you do this, but instead of seeing the selected record, you get the first record in the view, and you also get a JBO-25020 error, it might help if you read section 7.9.3, What You May Need to Know About Enabling View Object Key Management for Read-Only View Objects, of the Oracle ADF Developer’s Guide for Forms/4GL Developers.

By default setCurrentRowWithKey doesn’t work for read only View objects. The solution is simple, just call setManageRowByKey(true) in the create method of the view object.

Share and Enjoy:
  • del.icio.us
  • Google Bookmarks
  • DZone
  • LinkedIn
  • SphereIt
  • StumbleUpon
  • Technorati

4 Responses to “JBO-25020 errors when using setCurrentRowWithKey”

  1. Viliam Durina Says:

    Very interesting… I suppose, you get JBO-25020 when you don’t set this and try to use read-only VO with ADF binding? Because the error description says:

    JBO-25020: RowNotFoundException
    Cause: Attempting to find a referenced entity in the ViewRow failed due to a changed foreign-key value.
    Action: Provide a valid foreign-key value or remove the current one.

    I would not suppose such problem…

  2. Lucas Jellema Says:

    Andrej,

    My friends Google and Andrej were very helpful – I ran into this issue and did not understand a bit of it. Now I do and the problem is solved. Thanks a bunch.

    groeten,

    Lucas

  3. Andrej Says:

    Hi Lucas,
    Glad to be of help.
    Gr.,
    Andrej

  4. Pat Lee Says:

    There is a catch with this solution: there must be a key attribute set in the VO. Otherwise the solution will cause another error: JBO-25059: View Object WtVerbindingenView has ManageRowsByKey turned on, but its key definition is empty

Leave a Reply

Technology