managed beans as managed properties

Posted by Sean on Stack Overflow See other posts from Stack Overflow or by Sean
Published on 2010-05-24T17:11:55Z Indexed on 2010/05/26 14:11 UTC
Read the original article Hit count: 450

Filed under:

I am using JSF 1.1 on WebSphere 6.1. I am building search functionality within an application and am having some issues. I've stripped out the extras, and have left myself with the following:

4 managed beans:

  • SearchController - Controller bean, session scope
  • SearchResults - session scope (store the results)
  • ProductSearch - session scope (store the search conditions)
  • ResultsBacking - Backing bean for DataTable, used to determine which row was clicked, request scope

The SearchController bean has, as managed properties, the other 3. All except ResultsBacking are session scoped.

If there is only 1 item in the search results, I want to bring up that record directly. I call setFirst(0) for the data table in the ResultsBacking method (I want to use the existing method that handle which item was clicked, so this is called right after the setFirst).

When I go to do another search, I get an IllegalArgumentException when calling getRowData in the data table. According to the api, this is thrown 'if now(sic) row data is available at the currently specified row index'.

I'm confused as to why this happens. It works the first time but not the second. Do I need to remove the ResultsBacking on a new search to get rid of the old state?

© Stack Overflow or respective owner

Related posts about jsf