6 Replies Latest reply on Dec 13, 2006 1:49 PM by pmuir

    EntityQuery refresh

    jimk1723

      Question related to http://www.jboss.com/index.html?module=bb&op=viewtopic&t=97071...

      I'm trying to set up an EntityQuery as the basis for an auto-complete list; the resultList is updated on an ajax4jsf request which is working fine. The problem I'm running into is it seems the EntityQuery is refreshed during Apply Request Values before the model object that's providing the restriction is updated, i.e. it works, but it's always one character behind on keypress.

      I have a different working version that uses an action method (i.e. Invoke Application) along with a programmactically created EntityQuery (see the other thread), but I'd love to do away with all of this and just define the query component in components.xml.

      And ideas on how to get EntityQuery to refresh later?



        • 1. Re: EntityQuery refresh
          pmuir

          I ran into a problem (not using ajax). I had a conversation running so the criteria were not lost.

          The entity query would refresh during apply request values (obviously as the tree is restored), the criteria would be updated, and then the query requested for render response BUT as the query had already been run, it wasn't with the updated criteria.

          So, I made the query stateless (added scope="stateless") attribute, and it works as expected (just with a bit more overhead).

          • 2. Re: EntityQuery refresh
            gavin.king

            Pete, this sounds more like a bug, could you submit a testcase to JIRA? thanks.

            • 3. Re: EntityQuery refresh
              jimk1723

               

              "petemuir" wrote:
              I ran into a problem (not using ajax). I had a conversation running so the criteria were not lost.


              I might have the same situation; I'm on an edit page using an atomic conversation, e.g. flushmode=manual.

              I reinstated my components.xml EntityQuery, set the scope="stateless", and all seems to be working; I'm seeing two Hibernate info messages for the query, one in apply request values and one in render response.

              • 4. Re: EntityQuery refresh
                pmuir

                http://jira.jboss.org/jira/browse/JBSEAM-591

                I also can't get paging working as described in the documentation.

                • 5. Re: EntityQuery refresh
                  gavin.king

                  You can't? Did you check the contactlist example? It has pagination.

                  • 6. Re: EntityQuery refresh
                    pmuir

                    Ok, that was really an off the cuff remark, I need to investigate more throughly :)