0 Replies Latest reply on Jun 1, 2007 3:07 PM by Vinicius Carvalho

    Seam + Remoting + ajax4jsf question

    Vinicius Carvalho Apprentice

      Hello there! I'm trying these combination, and I'm bit confused with the mix, hope someone help me out.

      I'm using a Stateful bean that has a property:

      public class UserServiceBean implements UserSession{
      private User user;
      //this is a webremote method
      public void setUser(int id){
      this.user = em.find....
      public User getUser()

      So it's a pretty easy simple bean right :)

      The user clicks in a event that triggers the SeamRemoting method:
      userService = Seam.Component.getInstance("userService");

      So far so good, method is triggered and user is bound to the bean. So The user clicks on another component that uses ajax4jsf to re-render a panel:
      <img onclick="reDraw()"/>
      <a4j:jsFunction name="redraw" data="#{userService.user}" reRender="userPanel"/>
      <rich:panel id="userPanel">
      ... contents

      Now, what happens is that the getUser returns an empty user (as if it is an new invocation) If I call the set user, then reload the page, the user is still null. Seems that the Stateful bean is not being bound to the same client, ajax calls seems to be a different cllient to the container.
      I'm really confused on how to bind the ajax invocations to the stateful bean.

      Could someone give me some directions?