0 Replies Latest reply on Nov 16, 2007 4:33 PM by j-pro

    scrollableDataTable+a4j event handler - not always works

    j-pro

      It seems strange and to me, but it's this way.

      It seems that some quantity of consecutive rows works(click invokes event handler) and starting with one below them(and all consecutive) - don't work(click don't invoke the event handler).

      Below I'm showing you my code and a test with some logs. I've saved HTML of the tested pages and attached it(with debug JBoss logs) to created JIRA: http://jira.jboss.com/jira/browse/RF-1371

      Here is my rich:scrollableDataTable:

      <h:form id="staffDataTable_Form">
       <rich:scrollableDataTable id="staffDataTable" height="400px" rowKeyVar="rkv"
       binding="#{staffSDTableMan.sdTable}" selection="#{staffSDTableMan.scrollableDataTableSelection}"
       onRowMouseOver="this.style.backgroundColor='#B5CEFD'"
       onRowMouseOut="this.style.backgroundColor='#{org.richfaces.SKIN.tableBackgroundColor}'"
       rowClasses="sdt_row1,sdt_row2" selectedClass="sdt_row_selected" activeClass="sdt_row_active"
       width="500px" rows="0" columnClasses="sdt_col" frozenColCount="1"
       value="#{amBean.employeeListMan.staffEmployees}" var="employee" sortMode="single">
      
       <a4j:support event="onRowClick" onSubmit="this.style.backgroundColor='#000000" actionListener="#{staffSDTableMan.sdtRowSelected}" reRender="editWorker_panel_output">
       <a4j:actionparam name="tillJanuary08Parameter" value="#{employee.employeeId}" assignTo="#{amBean.parameterID}"/>
       </a4j:support>
      
      
       <rich:column id="firstName">
       <f:facet name="header"><h:outputText styleClass="sdt_head" value="First Name" /></f:facet>
       <h:outputText value="#{employee.firstName}" />
       </rich:column>
      
       <rich:column id="lastName">
       <f:facet name="header"><h:outputText styleClass="sdt_head" value="Last Name" /></f:facet>
       <h:outputText value="#{employee.lastName}" />
       </rich:column>
      
       <rich:column id="sex">
       <f:facet name="header"><h:outputText styleClass="sdt_head" value="Sex" /></f:facet>
       <h:outputText value="#{employee.sex}" />
       </rich:column>
      
       <rich:column id="birthDate">
       <f:facet name="header"><h:outputText styleClass="sdt_head" value="Birth Date" /></f:facet>
       <h:outputText value="#{employee.birthDate}" />
       </rich:column>
      
       <rich:column id="birthPlace">
       <f:facet name="header"><h:outputText styleClass="sdt_head" value="Birth Place" /></f:facet>
       <h:outputText value="#{employee.birthPlace}" />
       </rich:column>
      
       </rich:scrollableDataTable>
      
       <BR style="text-size:3px;"/>
      
      
       <a4j:commandButton disabled="true" action="#{staffSDTableMan.prepareNewWorker}" value="Make prikaz"></a4j:commandButton>
       <!-- <a href="javascript:Richfaces.showModalPanel('editWorker_panel',{width:700, top:200})">Edit</a> -->
       <a href="editpersdata.jsf" target="_blank" class="txtlink">Edit</a>
      
      </h:form>



      Here is my staffSDTableMan.sdtRowSelected:
      public void sdtRowSelected(ActionEvent event)
      {
       System.out.println("==============>>>>>>>>>>>>>>>>>>>>>> rowSelected");
      
       ActionsManager amBean = (ActionsManager)StaffSDataTableManager.getBean(WebConst.MAIN_MBEAN_NAME);
      
       String webPath2Photo = "";
      
       String employeePhotoPath = amBean.temp_prepareEmployee4EditFromStaffSDTable();
       if((employeePhotoPath == null)||(employeePhotoPath.length() == 0))
       {
       webPath2Photo = WebConst.NOPHOTO_PATHNAME;
       }
       else
       {
       webPath2Photo = this.makeWebPathFromRealPath(employeePhotoPath);
       }
      
       amBean.setImgPath(webPath2Photo);
      
       System.out.println("===> Employee from ROW set to amBean, ID: "+ amBean.getParameterID());
      }



      And here is my test(it's results are always persistent, even after redeployment):

      1. To show that all elements can work successfully: opening staff.jsf, the table contents all workers, except people from the Anket (in the tree on the left)

       a. Clicking on the last one(), log says:
      
       21:49:00,007 INFO [STDOUT] ==============>>>>>>>>>>>>>>>>>>>>>> rowSelected
       21:49:00,163 INFO [STDOUT] ===> Employee from ROW set to amBean, ID: 73
      
      
       b. Clicking on the pre-last one, log says:
      
       21:51:16,491 INFO [STDOUT] ==============>>>>>>>>>>>>>>>>>>>>>> rowSelected
       21:51:16,710 INFO [STDOUT] ===> Employee from ROW set to amBean, ID: 70
      
      
      
       ... etc, till the first one (all work well, checked!)
      
      
      
       x. Clicking on the first one, log says:
      
       21:52:56,366 INFO [STDOUT] ==============>>>>>>>>>>>>>>>>>>>>>> rowSelected
       21:52:56,585 INFO [STDOUT] ===> Employee from ROW set to amBean, ID: 52



      Notice: no matter, if I click from the end of the list till the start, or vice-versa. I can even don't click and just go in Ankets department and still face the bug.


      2. To show bug: clicking on the first node in the tree on the left - Anket. The table reloads with the new information, people who don't work, who are just pretenders.

       a. Clicking on the first one(dfgh gdfh), log says:
      
       22:00:39,976 INFO [STDOUT] ==============>>>>>>>>>>>>>>>>>>>>>> rowSelected
       22:00:40,179 INFO [STDOUT] ===> Employee from ROW set to amBean, ID: 50
      
      
       b. Clicking on the next one, log says:
      
       22:01:11,320 INFO [STDOUT] ==============>>>>>>>>>>>>>>>>>>>>>> rowSelected
       22:01:11,476 INFO [STDOUT] ===> Employee from ROW set to amBean, ID: 54
      
      
       c. Clicking on the next one, log says:
      
       22:01:42,804 INFO [STDOUT] ==============>>>>>>>>>>>>>>>>>>>>>> rowSelected
       22:01:42,913 INFO [STDOUT] ===> Employee from ROW set to amBean, ID: 57
      
      
       d. Clicking on the next one, log says:
      
       22:02:28,101 INFO [STDOUT] ==============>>>>>>>>>>>>>>>>>>>>>> rowSelected
       22:02:28,288 INFO [STDOUT] ===> Employee from ROW set to amBean, ID: 59
      
      
       e. Clicking on the next one, log says:
      
       22:02:36,460 INFO [STDOUT] ==============>>>>>>>>>>>>>>>>>>>>>> rowSelected
       22:02:36,616 INFO [STDOUT] ===> Employee from ROW set to amBean, ID: 63
      
      
       f. Clicking on the next one, log says:
      
       22:02:41,288 INFO [STDOUT] ==============>>>>>>>>>>>>>>>>>>>>>> rowSelected
       22:02:41,413 INFO [STDOUT] ===> Employee from ROW set to amBean, ID: 66
      
      
       g. Clicking on the next one, log says:
      
       22:02:44,476 INFO [STDOUT] ==============>>>>>>>>>>>>>>>>>>>>>> rowSelected
       22:02:44,648 INFO [STDOUT] ===> Employee from ROW set to amBean, ID: 67
      
      
       h. Clicking on the next one(sdf del), log says:
      
       22:02:48,148 INFO [STDOUT] ==============>>>>>>>>>>>>>>>>>>>>>> rowSelected
       22:02:48,273 INFO [STDOUT] ===> Employee from ROW set to amBean, ID: 71
      
      
       i. Clicking on the next one(sdf del), log says nothing(about invoking event handler)
       k. Clicking on the next one(666 del1), log says nothing(about invoking event handler)
       .... etc.
       x. Clicking on the next one(XXX XX), log says nothing(about invoking event handler)



      It's strange why event listener wasn't invoked. I've faced the problem for the first time and it's very important to me. I can't see any rule here, but the bug exists, it's true.

      I have one little request if it's possible. I use RichFaces in my project and really need this bug to be fixed till December(right after release of 3.1.3). I kindly ask you to fix it in 3.1.3, because end of January(3.2.0) - it's too much. Thanks for understanding.

      Saying again that JIRA was created for this bug: http://jira.jboss.com/jira/browse/RF-1371


      P.S.: Because of http://www.jboss.com/index.html?module=bb&op=viewtopic&t=121112 the name of actionParam parameter is "tillJanuary08Parameter" (when 3.2.0 will be released I'll move the parameter because of fixed bug)