3 Replies Latest reply on Jul 1, 2010 1:40 PM by hoperie

    scope is not active at ajax request

    jurijlender
      Hi,

      when clicking an ajax commandButton, i want a bean property to be populated with the current value of an iteration. The setter method is called, but unfortunately the value of the property remains null.

      view:
      <table>
      <a:repeat value="#{userBean.resultList}" var="_user">
      <tr>
      <td><h:outputText value="#{_user.name}" /></td>
      <td><a:commandButton ajaxSingle="true" value="Select" reRender="userDetail">
      <f:setPropertyActionListener value="#{_user}" target="#{userBean.selectedUser}" />
      <s:conversationId />
      </a:commandButton></td>
      </tr>
      </a:repeat>
      </table>


      *page.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <page xmlns="http://jboss.com/products/seam/pages"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.2.xsd">
              <begin-conversation join="true" flush-mode="auto"/>
      </page>


      action-bean:

      @Name("userBean")
      @Scope(ScopeType.CONVERSATION)
      public class UserBean {
             
              @In(create = true, required = false) EntityManager entityManager;
              @Logger Log log;
             
              private User selectedUser;

              [...]
      }



      the interesting part is, that i get the following warning in my console:

      14:22:53,695 WARN  [org.jboss.seam.Component] Cannot create Seam component, scope is not active: userBean(CONVERSATION)


      How is that possible? i have already searched for equivalent posts, also i have restarted the application on my server (using jboss 6 M2)
        • 1. Re: scope is not active at ajax request
          dhinojosa

          The root element for pages.xml is <pages> not <page>.  Another item is that the view doesn't look like it's in a form, you may have removed it to post here, but something to check into.  Let us know.

          • 2. Re: scope is not active at ajax request
            jurijlender

            Hi, thanks for your reply.


            Somehow it is working now. Although i don't know why.
            If i find out, i'll post what went wrong.

            • 3. Re: scope is not active at ajax request
              hoperie

              I have been digging a similar problem for a week. Your somehow just did not happened to me.  I narrowed done to a bare simple test --


              As long as I have a4j:repeat in my form (even with an empty body), all my ajax actions on the form produce this. Most time the action is actually executed without a problem.  But I cannot get anything working inside the repeat loop.


              WARN [org.jboss.seam.Component] Cannot create Seam component, scope is not active:



              If you have a clue how this is resolved, please do let me know.