5 Replies Latest reply on May 8, 2008 11:07 AM by Ziphyre Marco

    datascroller do not respond (3.2.0)

    Ziphyre Marco Newbie

      Hi,

      I don't know if I'm code blind but a very simple test do not work

      <h:form>
      <rich:dataTable id="testTable" var="msg" value="#{testList}" rows="3">
       <rich:column>
       #{msg.from.firstName}
       </rich:column> </rich:dataTable>
      <rich:datascroller for="testTable" />
      </h:form>


      the datatable and the datascroller populate themselves as expected,
      the datatable has 7 rows, so the scroller shows three pages.

      But when I click, say page 2, nothing happens, no request sent to the server. I don't know from where to start troubleshooting

      Here's my session bean:
      (But I expect that this is more to the client side, since no request is sent to the server)
      import java.util.List;
      
      import javax.ejb.Remove;
      import javax.ejb.Stateful;
      import javax.persistence.EntityManager;
      import javax.persistence.PersistenceContext;
      
      import org.jboss.seam.annotations.Destroy;
      import org.jboss.seam.annotations.Factory;
      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.annotations.datamodel.DataModel;
      
      import com.mobilmecra.snodd.entity.Message;
      
      @Name("test")
      @Stateful
      public class TestBean implements Test {
      
       @DataModel
       private List<Message> testList;
      
       @PersistenceContext
       private EntityManager em;
      
       @Factory("testList")
       public List<Message> findMessages() {
       testList = em.createQuery("from Message m where m.from = 1 order by m.sentDate DESC").getResultList();
       return testList;
       }
       @Remove @Destroy
       public void destroy() {}
      
      }



        • 1. Re: datascroller do not respond (3.2.0)
          Ziphyre Marco Newbie

          At home, I've tried with ie 7.0 and firefox on windows, I've upgraded to SR1.
          I tried to exclude Seam artifacts, and changed my bean to:

          @Stateless
          public class TestBean implements Test {
          
           @PersistenceContext
           EntityManager em;
          
           @DataModel
           private List<Message> testList;
          
           public List<Message> getTestList() {
           testList = em.createQuery("From Message m where m.from = 1 order by m.sentDate DESC").getResultList();
           return testList;
           }
           public void setTestList(List<Message> testList) {
           this.testList = testList;
           }
          }


          Nothing... Same unclickable page links and arrows. This part is really important for me and I'm stuck. I'd mostly appreciate if you could give a hand.
          Thanks...

          • 2. Re: datascroller do not respond (3.2.0)
            Nick Belaevski Master

            Hello,

            That should work... Do you have any errors in browser javascript console?

            • 3. Re: datascroller do not respond (3.2.0)
              Ziphyre Marco Newbie

               

              "nbelaevski" wrote:
              Hello,

              That should work... Do you have any errors in browser javascript console?


              Hello,
              nope, nothing, no error, no warnings
              this is the rendered td for page 2 on the scroller:

              <td class="dr-dscr-inact rich-datascr-inact"
              onclick="Event.fire(this, 'rich:datascroller:onscroll',
              {'page': '2'});">2</td>


              this are the script tags added by the system to my page:
              <script type='text/javascript' src='/snodd/a4j_3_2_0.SR1-SNAPSHOTorg.ajax4jsf.javascript.AjaxScript'></script>
              <script type='text/javascript' src='/snodd/a4j_3_2_0.SR1-SNAPSHOTorg/ajax4jsf/javascript/scripts/form
              .js'></script>
              <script type='text/javascript' src='/snodd/a4j_3_2_0.SR1-SNAPSHOTorg.ajax4jsf.javascript.PrototypeScr
              ipt'></script>
              <script type='text/javascript' src='/snodd/a4j_3_2_0.SR1-SNAPSHOTorg/richfaces/renderkit/html/scripts
              /data-table.js'>


              and this is the script under the datascroller, everything seems fine to me:
              <script type="text/javascript">
              //<![CDATA[
              Event.observe('testForm:testScroller', 'rich:datascroller:onscroll', function(event){A4J.AJAX.Submit('_viewRoot','testForm',event,{'eventsQueue':'testForm:testScroller','parameters':{'testForm:testScroller':event.memo.page,'ajaxSingle':'testForm:testScroller'} ,'actionUrl':'/snodd/home.seam','ignoreDupResponses':true} ); return false;});
              //]]>
              </script>


              • 4. Re: datascroller do not respond (3.2.0)
                Ziphyre Marco Newbie

                Resolved
                It turns out that the Prototype library is loaded two times, on internally and the other by a tag and not the same version...
                Sorry for bothering...

                • 5. Re: datascroller do not respond (3.2.0)
                  Ziphyre Marco Newbie

                  script tag of a different version