5 Replies Latest reply on May 12, 2007 9:00 AM by Ever Last

    can't gett poll running with dataTable

    Ever Last Newbie

      Hello,

      i have some problems getting poll running with datatable
      the thing it seems the it gets rerendered but just the last line and not the whole list

       <h:form>
       <a:poll id="picker" interval="2000" reRender="outValue,CrawlerStatusTable,picker"
       action="#{crawler.getValue}" />
      
       <h:outputText id="outValue" value="#{crawler.value}" />
      
       <h:dataTable id="CrawlerStatusTable" value="#{crawler.crawlStatus}"
       var="line">
       <h:column>
       #{line}
       <br />
       </h:column>
       </h:dataTable>
       </h:form>
      


      this ist my javaBean

      
       @Out(required = false)
       List<String> crawlStatus;
      
       public void crawler() {
       if (crawlStatus == null){
       crawlStatus = new Vector<String>();
       }
      
       log.info("crawler.crawler() action called with: #{crawler.value}");
       facesMessages.add("crawler #{crawler.value}");
       new Thread(this).start();
      
       }
      
       public void run() {
       for (int j = 0; j < 10; j++) {
       for (int ij = 0; ij < 1000000; ij++)
      
       crawlStatus.add("test" + " : " + String.valueOf(j));
       log.info(crawlStatus.get(j));
       }
       }
      


      I made already some post on the mailing list

      http://www.nabble.com/poll-question-tf3728333.html


      I am running out of ideas

        • 1. Re: can't gett poll running with dataTable
          Sergey Smirnov Master

          ajax4jsf 1.1.1 is required here

          • 2. Re: can't gett poll running with dataTable
            Ever Last Newbie

            I use Seam 1.2.1 GA and it comes with ajax4jsf 1.1.1 i still have no clue why it isnt working.

            • 3. Re: can't gett poll running with dataTable
              Ever Last Newbie

              ok it looks like that this is a new feature and maybe it wont work yet i dont know.

              what I am basicly looking for is: If an element is added to my list the new line and the previous one should be displayed in the browser. are there any workarounds, or another aproach ?


              regards

              • 4. Re: can't gett poll running with dataTable
                Sergey Smirnov Master

                It was not about new feature, but about the fixed bug when the dataTable is not updated when reRender points to it.

                Actually, 1.1.1 is not finally released, so Seam distributes not the latest one. Make sense to try RC2 ( http://jboss.com/index.html?module=bb&op=viewtopic&t=108101 ) . Just one jar file is required to be updated. If your problem not because this concrete bug, you can roll over the version.

                • 5. Re: can't gett poll running with dataTable
                  Ever Last Newbie

                  Since yesterday i have the SVN Trunk version of ajax4jsf and i also tried the version you posted. In both cases it didnt worked.

                  I was tweacking on the code for two days now. Looking in the Ajax4jsf code didnt helped either. I will give up on it for now.

                  This is the poing where is stopped


                  <rich:panel>
                   <h:form>
                   <a:log hotkey="M"></a:log>
                   <a:poll id="picker" interval="1500"
                   reRender="CrawlerStatusTable,picker" action="#{crawler.doNothing}"
                   ajaxSingle="true" />
                  
                   <h:dataTable id="CrawlerStatusTable" value="#{crawler.crawlStatus}"
                   var="line">
                   <h:column>
                   #{line}
                   </h:column>
                   </h:dataTable>
                   </h:form>
                  
                   </rich:panel>
                  


                  And the Java Bean

                  
                   @Out(required = false)
                   List<String> crawlStatus;
                  
                   public void crawler() {
                   if (crawlStatus == null){
                   crawlStatus = new Vector<String>();
                   crawlStatus.add("first element");
                   }
                   log.info("crawler.crawler() action called with: #{crawler.value}");
                   new Thread(this).start();
                   }
                  
                   public void run() {
                   for (int j = 0; j < 10; j++) {
                   for (int ij = 0; ij < 1000000; ij++)
                   Math.hypot(0.342, 0.45);
                  
                   crawlStatus.add("\niteration" + " : " + String.valueOf(j));
                   log.info("iteration" + " : " + String.valueOf(j));
                   }
                   }
                  


                  The result so far is that, after termination of the crawler() function, I see one element on the screen.("first element")
                  On the first reRender interval this gets deleted, but no new values which are generated by the thread are added although the getCrawlStatus function gets polled in the background.

                  P.S.
                  InpuTextArea isn't working either with
                  dataTable did try it out already ;-)


                  If somebody hase brilliant idea I am open for any comment.


                  Regards

                  V.