0 Replies Latest reply on Apr 12, 2008 8:08 AM by Roberto Urban

    rich:datatable a very strange refresh problem

    Roberto Urban Newbie

      Hi all,
      I read a lot of messages in this forums, but this is my first post. I'm writing here since I'm frustrated.
      I developed a quite complex UI with richfaces component which aim to do activities reassignment among some operators.
      My interface has the list of activities to reassign on left, the list of operators an the right and underneath both of them the list of already reassigned activities.
      Here my JSP code:

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:rich="http://richfaces.org/rich"
       xmlns:a4j="http://richfaces.org/a4j"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:t="http://myfaces.apache.org/tomahawk">
      
      <f:loadBundle basename="resources" var="msg" />
      <ui:composition template="/templates/default.xhtml">
      
       <ui:define name="pageTitle">
       <h:outputText value="#{msg.titleInbox}"></h:outputText>
       </ui:define>
      
       <ui:define name="pageTop">
       <ui:include src="/pages/admin/top.xhtml" />
       </ui:define>
      
       <ui:define name="pageBody">
       <a4j:form id="bodyForm">
       <style>
      .colLabel {
       width: 100px;
      }
      
      .colField {
      
      }
      
      .colImg {
       width: 21px;
       text-align: left;
      }
      
      .colDelivery {
       width: 60px;
       text-align: left;
      }
      
      .colUser {
       width: 100px;
       text-align: left;
      }
      
      .colCustomer {
       width: 150px;
       text-align: left;
      }
      
      .colButton {
       width: 80px;
       text-align: left;
      }
      
      .colDesc {
       cursor: move;
       text-align: left;
      }
      
      .colDescReassignedAct {
       text-align: left;
      }
      
      .colPrio {
       width: 50px;
       text-align: left;
      }
      
      .colOra {
       width: 70px;
       text-align: left;
      }
      
      .colToll {
       width: 90px;
       text-align: left;
      }
      
      .colNumber {
       width: 30px;
       text-align: left;
      }
      
      .centralColPanel {
       vertical-align: top;
      }
      
      .colPanel {
       vertical-align: top;
       width: 50%;
      }
      
      .multiAssignPanel {
       width: 99%;
       margin-top: 4px;
       margin-right: 2px;
       font-weight: bold;
       height: 40px;
       background-color: #FFFFFF;
      }
      
      .multiAssignPanelBody {
       background-color: #FFFFFF;
      }
      
      .mainPanel {
       width: 50%;
       padding: 0px;
       vertical-align: top;
      }
      
      .mainRightPanel {
       vertical-align: top;
       min-height: 405px;
       margin-left: 2px;
      }
      
      .mainLeftPanel {
       vertical-align: top;
       min-height: 373px;
       margin-right: 2px;
      }
      
      .first_warning {
       background-color: red;
       padding: 5px;
      }
      
      .second_warning {
       background-color: orange;
       padding: 5px;
      }
      
      .third_warning {
       background-color: yellow;
       padding: 5px;
      }
      
      .operator_username_col {
       padding: 5px;
       text-align: left;
      }
      
      .operator_seniority_col {
       width: 40px;
       text-align: left;
       padding: 3px;
      }
      
      .operator_saturation_col {
       width: 30px;
       text-align: left;
       padding: 3px;
      }
      
      .commandBtnImage {
       border: 0px;
      }
      </style>
      
       <script>
       function changeSelImg(obj){
       var src = obj.src;
       if(src.indexOf("rowPicker.gif")>=0){
       obj.src = "/MimesiBackOffice/resources/rowPickerSelected.gif"
       }else{
       obj.src = "/MimesiBackOffice/resources/rowPicker.gif"
       }
       }
      
       function hideContextMenu(obj){
       obj.doHide();
       //alert("ciao");
       }
       </script>
      
       <rich:dragIndicator id="indicator">
       <f:facet name="multy">
       <f:verbatim> </f:verbatim>
       </f:facet>
       </rich:dragIndicator>
      
       <br />
      
       <div style="width: 100%; text-align: center;">
       <div style="width: 99%; text-align: left;"><h:panelGrid
       columns="6" columnClasses="colLabel,colField,colLabel,colField"
       styleClass="searchZone">
      
       <h:outputLabel value="#{msg.labelUser}"></h:outputLabel>
       <h:selectOneMenu value="#{reassignMonitorActivities.idUser}">
       <f:selectItem itemLabel="#{msg.keywordTutti}" itemValue="0" />
       <f:selectItems value="#{reassignMonitorActivities.usersChoices}" />
       </h:selectOneMenu>
      
       <h:outputLabel value="#{msg.labelData}"></h:outputLabel>
       <rich:calendar value="#{reassignMonitorActivities.date}" />
      
       <h:outputLabel value="#{msg.labelService}"></h:outputLabel>
       <h:selectOneMenu value="#{reassignMonitorActivities.idService}">
       <f:selectItem itemLabel="Moderazione" itemValue="3" />
       </h:selectOneMenu>
      
       <h:outputLabel value="#{msg.labelCustomer}"></h:outputLabel>
       <h:selectOneMenu value="#{reassignMonitorActivities.idCustomer}"
       style="width:150px;">
       <f:selectItem itemLabel="#{msg.keywordTutti}" itemValue="0" />
       <f:selectItems
       value="#{reassignMonitorActivities.customersChoices}" />
       </h:selectOneMenu>
      
       <f:facet name="footer">
       <a4j:commandButton value="#{msg.buttonFilterMonitorActivity}"
       action="#{reassignMonitorActivities.searchAction}"
       id="submitButton" reRender="actsToAssing,operatorsList" />
       </f:facet>
       </h:panelGrid> <a4j:status id="stateMonitor">
       <f:facet name="start">
       <h:outputText value="#{msg.messageInProgress}"
       styleClass="progressBar" />
       </f:facet>
       </a4j:status> <br />
      
       <h:panelGrid columns="2" style="width:100%;padding:0px;margin:0px;"
       columnClasses="mainPanel,mainPanel">
       <rich:panel id="actsToAssing" styleClass="mainLeftPanel">
       <f:facet name="header">
       <h:outputFormat id="leftPanelHeader"
       value="#{msg.panelReassingActsToAssign}">
       <f:param value="#{reassignMonitorActivities.numberOf}" />
       </h:outputFormat>
       </f:facet>
       <h:panelGrid columns="4">
       <a4j:commandLink
       actionListener="#{reassignMonitorActivities.selectAllActivities}"
       reRender="actsList,actsToDrag" limitToList="true">
       <h:graphicImage styleClass="commandBtnImage"
       title="#{msg.selectAllActivities}"
       value="/resources/selectAll.gif" />
       </a4j:commandLink>
       <a4j:commandLink
       actionListener="#{reassignMonitorActivities.deselectAllActivities}"
       reRender="actsList,actsToDrag" limitToList="true">
       <h:graphicImage styleClass="commandBtnImage"
       title="#{msg.deselectAllActivities}"
       value="/resources/deselectAll.gif" />
       </a4j:commandLink>
       </h:panelGrid>
       <div
       style="height: 300px; width: 100%; overflow-y: scroll; padding: 0px;">
      
       <rich:dataTable value="#{sessionManager.activities}" var="act"
       rowKeyVar="rkv" rowClasses="oddRow,evenRow"
       columnClasses="colImg,colImg,colUser,colCustomer,colDesc,colNumber,colNumber"
       styleClass="content" style="width:97%;" id="actsList">
       <h:column id="colImageurl">
       <f:facet name="header">
       <f:verbatim> </f:verbatim>
       </f:facet>
       <h:graphicImage value="#{act.imageurl}"
       rendered="#{empty act.endprocessing}" />
       <h:outputText rendered="#{!empty act.endprocessing}">
       <f:verbatim> </f:verbatim>
       </h:outputText>
       </h:column>
       <h:column id="colRowSel">
       <f:facet name="header">
       <f:verbatim> </f:verbatim>
       </f:facet>
       <a4j:commandLink ajaxSingle="true"
       actionListener="#{reassignMonitorActivities.reassignRowSelection}"
       reRender="actsToDrag" onmouseout="hideContextMenu(document.getElementById('bodyForm:contextMenu').component);" oncomplete="hideContextMenu(document.getElementById('bodyForm:contextMenu').component);">
       <a4j:actionparam name="selRow" value="#{rkv}"></a4j:actionparam>
       <h:graphicImage styleClass="commandBtnImage"
       onclick="changeSelImg(this)"
       value="#{ (act.selected==false) ? '/resources/rowPicker.gif' : '/resources/rowPickerSelected.gif'}"
       rendered="#{empty act.endprocessing}" />
       </a4j:commandLink>
       </h:column>
       <h:column id="colUser">
       <f:facet name="header">
       <a4j:commandLink value="#{msg.columnInboxUser}"
       action="#{reassignMonitorActivities.sortUsersNames}"
       reRender="actsList" ajaxSingle="true" />
       </f:facet>
       <h:outputText value="#{act.iduser.fullname}" />
       </h:column>
      
       <h:column id="colCustomer">
       <f:facet name="header">
       <a4j:commandLink value="#{msg.columnInboxCustomer}"
       action="#{reassignMonitorActivities.sortCustomerNames}"
       reRender="actsList" ajaxSingle="true" />
       </f:facet>
       <h:outputText value="#{act.customer.customername}" />
       </h:column>
      
       <h:column id="colDescription">
       <f:facet name="header">
       <h:outputText value="#{msg.columnInboxDescrizione}"></h:outputText>
       </f:facet>
       <a4j:outputPanel layout="block">
       <rich:dragSupport dragType="activity"
       dragIndicator="bodyForm:indicator" dragValue="#{act}">
       <rich:dndParam name="label" value="#{act.description}" />
       </rich:dragSupport>
      
       <h:outputText value="#{act.description}" />
       </a4j:outputPanel>
       </h:column>
      
       <h:column id="colDuration">
       <f:facet name="header">
       <a4j:commandLink value="#{msg.columnInboxDuration}"
       action="#{reassignMonitorActivities.sortDurata}"
       reRender="actsList" ajaxSingle="true" />
       </f:facet>
       <h:outputText value="#{act.duration}" />
       </h:column>
      
       <h:column id="colDifficulty">
       <f:facet name="header">
       <a4j:commandLink value="#{msg.columnInboxDifficulty}"
       action="#{reassignMonitorActivities.sortDifficolta}"
       reRender="actsList" ajaxSingle="true" />
       </f:facet>
       <h:outputText value="#{act.difficulty}" />
       </h:column>
       <rich:componentControl event="onRowClick" for="contextMenu"
       operation="show">
       <f:param value="#{act.idmonitoractivity}"
       name="idmonitoractivity" />
       </rich:componentControl>
       </rich:dataTable> <rich:contextMenu attached="false" id="contextMenu"
       submitMode="ajax" event="onRowClick" onexpand="">
       <rich:menuItem reRender="actsList,leftPanelHeader" limitToList="true" value="#{msg.buttonCompleta}"
       actionListener="#{reassignMonitorActivities.terminateAction}">
       <f:param value="{idmonitoractivity}" name="idmonitoractivity"/>
       </rich:menuItem>
       </rich:contextMenu></div>
      
       <rich:panel styleClass="multiAssignPanel" id="dragMultiActs"
       bodyClass="multiAssignPanelBody">
       <a4j:outputPanel id="actsToDrag" layout="block">
       <!-- <rich:dragSupport dragType="activity"
       dragIndicator="bodyForm:indicator"
       dragValue="#{sessionManager.reassignActivitiesSelection}">
       <rich:dndParam name="label" value="#{msg.labelRiassegnazioneMultipla}" />
       </rich:dragSupport>-->
       <h:outputFormat value="#{msg.labelNumSelectedActsToReassign}"
       rendered="#{sessionManager.reassignActivitiesSelectionSize>0}">
       <f:param
       value="#{sessionManager.reassignActivitiesSelectionSize}" />
       </h:outputFormat>
       <h:outputText value="#{msg.labelNoSelectedActsToReassign}"
       rendered="#{sessionManager.reassignActivitiesSelectionSize==0}"></h:outputText>
       <br />
       <a4j:repeat rows="20"
       value="#{sessionManager.reassignActivitiesSelection}">
       <h:graphicImage styleClass="commandBtnImage"
       value="/resources/rowPickerSelected.gif" />
       </a4j:repeat>
       <h:outputText value="..."
       rendered="#{sessionManager.reassignActivitiesSelectionSize gt 20}"></h:outputText>
       </a4j:outputPanel>
       </rich:panel>
       </rich:panel>
      
       <rich:panel styleClass="mainRightPanel">
      
       <f:facet name="header">
       <h:outputFormat id="rigthPanelHeader" value="#{msg.panelReassingUsersToAssign}"></h:outputFormat>
       </f:facet>
      
       <h:panelGroup id="pnlMessages">
       <rich:messages passedLabel="Data is allowed to be stored."
       layout="list" showDetail="false" showSummary="true">
       <f:facet name="header">
       <h:outputText value="Entered Data Status:"></h:outputText>
       </f:facet>
       <f:facet name="passedMarker">
       <h:graphicImage value="/resources/passed.gif" />
       </f:facet>
       <f:facet name="errorMarker">
       <h:graphicImage value="/resources/error.gif" />
       </f:facet>
       </rich:messages>
       </h:panelGroup>
      
       <div
       style="height: 381px; width: 100%; overflow-y: auto; padding: 0px;">
       <rich:dataTable styleClass="content" var="operator" cellpadding="3"
       style="width:97%;" value="#{sessionManager.operators}"
       id="operatorsList" rowClasses="oddRow,evenRow"
       columnClasses="operator_username_col,operator_seniority_col,operator_saturation_col,operator_saturation_col,operator_saturation_col,operator_saturation_col,operator_saturation_col,operator_saturation_col,operator_saturation_col,operator_saturation_col,operator_saturation_col,operator_saturation_col,operator_saturation_col,operator_saturation_col,operator_saturation_col,operator_saturation_col,operator_saturation_col,operator_saturation_col,operator_saturation_col">
      
       <h:column id="fullname">
       <f:facet name="header">
       <h:outputText value="#{msg.columnInboxUser}"></h:outputText>
       </f:facet>
       <a4j:outputPanel layout="block">
       <rich:dropSupport id="userObj" acceptedTypes="activity"
       dropValue="#{operator}" reRender="operatorsList"
       dropListener="#{reassignDropListener.processDrop}">
       <a4j:support event="ondrop" limitToList="true"
       reRender="reassignedActsListPanel,actsList,dragMultiActs,leftPanelHeader"></a4j:support>
       </rich:dropSupport>
       <h:outputText value="#{operator.user.fullname}"></h:outputText>
       </a4j:outputPanel>
       </h:column>
      
       <h:column id="seniority">
       <f:facet name="header">
       <h:outputText value="#{msg.operatorFieldSeniority}"></h:outputText>
       </f:facet>
       <h:outputText value="#{operator.seniority}"></h:outputText>
       </h:column>
      
       <h:column id="sat7"
       rendered="#{7 ge reassignMonitorActivities.hourAtNow-2 and 7 le reassignMonitorActivities.hourAtNow+2}">
       <f:facet name="header">
       <a4j:commandLink value="#{msg.operatorFieldHourSaturation}7"
       action="#{reassignMonitorActivities.sortSaturation}"
       reRender="operatorsList" limitToList="true" ajaxSingle="true" >
       <f:param value="7"
       name="durationHour" />
       </a4j:commandLink>
       </f:facet>
       <h:outputText value="#{operator.saturationTill7}"
       styleClass="#{operator.satCellCssClassTill7}">
       <f:convertNumber type="number" locale="Locale.ITALY"
       maxFractionDigits="0" minFractionDigits="0" />
       </h:outputText>
       </h:column>
      
       <h:column id="sat8"
       rendered="#{8 ge reassignMonitorActivities.hourAtNow-2 and 8 le reassignMonitorActivities.hourAtNow+2}">
       <f:facet name="header">
       <a4j:commandLink value="#{msg.operatorFieldHourSaturation}8"
       action="#{reassignMonitorActivities.sortSaturation}"
       reRender="operatorsList" limitToList="true" ajaxSingle="true" >
       <f:param value="8"
       name="durationHour" />
       </a4j:commandLink>
       </f:facet>
       <h:outputText value="#{operator.saturationTill8}"
       styleClass="#{operator.satCellCssClassTill8}">
       <f:convertNumber type="number" locale="Locale.ITALY"
       maxFractionDigits="0" minFractionDigits="0" />
       </h:outputText>
       </h:column>
      
       <h:column id="sat9"
       rendered="#{9 ge reassignMonitorActivities.hourAtNow-2 and 9 le reassignMonitorActivities.hourAtNow+2}">
       <f:facet name="header">
       <a4j:commandLink value="#{msg.operatorFieldHourSaturation}9"
       action="#{reassignMonitorActivities.sortSaturation}"
       reRender="operatorsList" limitToList="true" ajaxSingle="true" >
       <f:param value="9"
       name="durationHour" />
       </a4j:commandLink>
       </f:facet>
       <h:outputText value="#{operator.saturationTill9}"
       styleClass="#{operator.satCellCssClassTill9}">
       <f:convertNumber type="number" locale="Locale.ITALY"
       maxFractionDigits="0" minFractionDigits="0" />
       </h:outputText>
       </h:column>
      
       <h:column id="sat10"
       rendered="#{10 ge reassignMonitorActivities.hourAtNow-2 and 10 le reassignMonitorActivities.hourAtNow+2}">
       <f:facet name="header">
       <a4j:commandLink value="#{msg.operatorFieldHourSaturation}10"
       action="#{reassignMonitorActivities.sortSaturation}"
       reRender="operatorsList" limitToList="true" ajaxSingle="true" >
       <f:param value="10"
       name="durationHour" />
       </a4j:commandLink>
       </f:facet>
       <h:outputText value="#{operator.saturationTill10}"
       styleClass="#{operator.satCellCssClassTill10}">
       <f:convertNumber type="number" locale="Locale.ITALY"
       maxFractionDigits="0" minFractionDigits="0" />
       </h:outputText>
       </h:column>
      
       <h:column id="sat11"
       rendered="#{11 ge reassignMonitorActivities.hourAtNow-2 and 11 le reassignMonitorActivities.hourAtNow+2}">
       <f:facet name="header">
       <a4j:commandLink value="#{msg.operatorFieldHourSaturation}11"
       action="#{reassignMonitorActivities.sortSaturation}"
       reRender="operatorsList" limitToList="true" ajaxSingle="true" >
       <f:param value="11"
       name="durationHour" />
       </a4j:commandLink>
       </f:facet>
       <h:outputText value="#{operator.saturationTill11}"
       styleClass="#{operator.satCellCssClassTill11}">
       <f:convertNumber type="number" locale="Locale.ITALY"
       maxFractionDigits="0" minFractionDigits="0" />
       </h:outputText>
       </h:column>
      
       <h:column id="sat12"
       rendered="#{12 ge reassignMonitorActivities.hourAtNow-2 and 12 le reassignMonitorActivities.hourAtNow+2}">
       <f:facet name="header">
       <a4j:commandLink value="#{msg.operatorFieldHourSaturation}12"
       action="#{reassignMonitorActivities.sortSaturation}"
       reRender="operatorsList" limitToList="true" ajaxSingle="true" >
       <f:param value="12"
       name="durationHour" />
       </a4j:commandLink>
       </f:facet>
       <h:outputText value="#{operator.saturationTill12}"
       styleClass="#{operator.satCellCssClassTill12}">
       <f:convertNumber type="number" locale="Locale.ITALY"
       maxFractionDigits="0" minFractionDigits="0" />
       </h:outputText>
       </h:column>
      
       <h:column id="sat13"
       rendered="#{13 ge reassignMonitorActivities.hourAtNow-2 and 13 le reassignMonitorActivities.hourAtNow+2}">
       <f:facet name="header">
       <a4j:commandLink value="#{msg.operatorFieldHourSaturation}13"
       action="#{reassignMonitorActivities.sortSaturation}"
       reRender="operatorsList" limitToList="true" ajaxSingle="true" >
       <f:param value="13"
       name="durationHour" />
       </a4j:commandLink>
       </f:facet>
       <h:outputText value="#{operator.saturationTill13}"
       styleClass="#{operator.satCellCssClassTill13}">
       <f:convertNumber type="number" locale="Locale.ITALY"
       maxFractionDigits="0" minFractionDigits="0" />
       </h:outputText>
       </h:column>
      
       <h:column id="sat14"
       rendered="#{14 ge reassignMonitorActivities.hourAtNow-2 and 14 le reassignMonitorActivities.hourAtNow+2}">
       <f:facet name="header">
       <a4j:commandLink value="#{msg.operatorFieldHourSaturation}14"
       action="#{reassignMonitorActivities.sortSaturation}"
       reRender="operatorsList" limitToList="true" ajaxSingle="true" >
       <f:param value="14"
       name="durationHour" />
       </a4j:commandLink>
       </f:facet>
       <h:outputText value="#{operator.saturationTill14}"
       styleClass="#{operator.satCellCssClassTill14}">
       <f:convertNumber type="number" locale="Locale.ITALY"
       maxFractionDigits="0" minFractionDigits="0" />
       </h:outputText>
       </h:column>
      
       <h:column id="sat15"
       rendered="#{15 ge reassignMonitorActivities.hourAtNow-2 and 15 le reassignMonitorActivities.hourAtNow+2}">
       <f:facet name="header">
       <a4j:commandLink value="#{msg.operatorFieldHourSaturation}15"
       action="#{reassignMonitorActivities.sortSaturation}"
       reRender="operatorsList" limitToList="true" ajaxSingle="true" >
       <f:param value="15"
       name="durationHour" />
       </a4j:commandLink>
       </f:facet>
       <h:outputText value="#{operator.saturationTill15}"
       styleClass="#{operator.satCellCssClassTill15}">
       <f:convertNumber type="number" locale="Locale.ITALY"
       maxFractionDigits="0" minFractionDigits="0" />
       </h:outputText>
       </h:column>
      
       <h:column id="sat16"
       rendered="#{16 ge reassignMonitorActivities.hourAtNow-2 and 16 le reassignMonitorActivities.hourAtNow+2}">
       <f:facet name="header">
       <a4j:commandLink value="#{msg.operatorFieldHourSaturation}16"
       action="#{reassignMonitorActivities.sortSaturation}"
       reRender="operatorsList" limitToList="true" ajaxSingle="true" >
       <f:param value="16"
       name="durationHour" />
       </a4j:commandLink>
       </f:facet>
       <h:outputText value="#{operator.saturationTill16}"
       styleClass="#{operator.satCellCssClassTill16}">
       <f:convertNumber type="number" locale="Locale.ITALY"
       maxFractionDigits="0" minFractionDigits="0" />
       </h:outputText>
       </h:column>
       <h:column id="sat17"
       rendered="#{17 ge reassignMonitorActivities.hourAtNow-2 and 17 le reassignMonitorActivities.hourAtNow+2}">
       <f:facet name="header">
       <a4j:commandLink value="#{msg.operatorFieldHourSaturation}17"
       action="#{reassignMonitorActivities.sortSaturation}"
       reRender="operatorsList" limitToList="true" ajaxSingle="true" >
       <f:param value="17"
       name="durationHour" />
       </a4j:commandLink>
       </f:facet>
       <h:outputText value="#{operator.saturationTill17}"
       styleClass="#{operator.satCellCssClassTill17}">
       <f:convertNumber type="number" locale="Locale.ITALY"
       maxFractionDigits="0" minFractionDigits="0" />
       </h:outputText>
       </h:column>
      
       <h:column id="sat18"
       rendered="#{18 ge reassignMonitorActivities.hourAtNow-2 and 18 le reassignMonitorActivities.hourAtNow+2}">
       <f:facet name="header">
       <a4j:commandLink value="#{msg.operatorFieldHourSaturation}18"
       action="#{reassignMonitorActivities.sortSaturation}"
       reRender="operatorsList" limitToList="true" ajaxSingle="true" >
       <f:param value="18"
       name="durationHour" />
       </a4j:commandLink>
       </f:facet>
       <h:outputText value="#{operator.saturationTill18}"
       styleClass="#{operator.satCellCssClassTill18}">
       <f:convertNumber type="number" locale="Locale.ITALY"
       maxFractionDigits="0" minFractionDigits="0" />
       </h:outputText>
       </h:column>
      
       <h:column id="sat19"
       rendered="#{19 ge reassignMonitorActivities.hourAtNow-2 and 19 le reassignMonitorActivities.hourAtNow+2}">
       <f:facet name="header">
       <a4j:commandLink value="#{msg.operatorFieldHourSaturation}19"
       action="#{reassignMonitorActivities.sortSaturation}"
       reRender="operatorsList" limitToList="true" ajaxSingle="true" >
       <f:param value="19"
       name="durationHour" />
       </a4j:commandLink>
       </f:facet>
       <h:outputText value="#{operator.saturationTill19}"
       styleClass="#{operator.satCellCssClassTill19}">
       <f:convertNumber type="number" locale="Locale.ITALY"
       maxFractionDigits="0" minFractionDigits="0" />
       </h:outputText>
       </h:column>
      
       <h:column id="sat20"
       rendered="#{20 ge reassignMonitorActivities.hourAtNow-2 and 20 le reassignMonitorActivities.hourAtNow+2}">
       <f:facet name="header">
       <a4j:commandLink value="#{msg.operatorFieldHourSaturation}20"
       action="#{reassignMonitorActivities.sortSaturation}"
       reRender="operatorsList" limitToList="true" ajaxSingle="true" >
       <f:param value="20"
       name="durationHour" />
       </a4j:commandLink>
       </f:facet>
       <h:outputText value="#{operator.saturationTill20}"
       styleClass="#{operator.satCellCssClassTill20}">
       <f:convertNumber type="number" locale="Locale.ITALY"
       maxFractionDigits="0" minFractionDigits="0" />
       </h:outputText>
       </h:column>
       </rich:dataTable></div>
       </rich:panel>
       </h:panelGrid> <br />
      
       <rich:simpleTogglePanel id="reassignedActsListPanel"
       switchType="ajax" label="#{msg.panelReassignedUserActs}"
       opened="#{not empty sessionManager.reassignedActivities}"
       limitToList="true">
       <h:panelGrid columns="4">
       <a4j:commandLink
       actionListener="#{reassignMonitorActivities.selectAllReassignedActivities}"
       reRender="reassignedActsListPanel" limitToList="true">
       <h:graphicImage styleClass="commandBtnImage"
       title="#{msg.selectAllActivities}"
       value="/resources/selectAll.gif" />
       </a4j:commandLink>
       <a4j:commandLink
       actionListener="#{reassignMonitorActivities.deselectAllReassignedActivities}"
       reRender="reassignedActsListPanel" limitToList="true">
       <h:graphicImage styleClass="commandBtnImage"
       title="#{msg.deselectAllActivities}"
       value="/resources/deselectAll.gif" />
       </a4j:commandLink>
       <a4j:commandLink
       actionListener="#{reassignMonitorActivities.deleteReassignedActions}"
       reRender="reassignedActsListPanel,actsList,operatorsList"
       limitToList="true">
       <h:graphicImage styleClass="commandBtnImage"
       title="#{msg.deleteRessignedActivities}"
       value="/resources/cestino.gif" />
       </a4j:commandLink>
       <a4j:commandLink
       actionListener="#{reassignMonitorActivities.commitReassignedActions}"
       reRender="reassignedActsListPanel,actsList,operatorsList"
       limitToList="true">
       <h:graphicImage styleClass="commandBtnImage"
       title="#{msg.commitReassignedActivities}"
       value="/resources/riassegna_attivita1.gif" />
       </a4j:commandLink>
       </h:panelGrid>
       <div
       style="height: 150px; width: 100%; overflow-y: auto; padding: 0px;">
       <rich:dataTable value="#{sessionManager.reassignedActivities}"
       var="reassAct" rowKeyVar="rrkv" rowClasses="oddRow,evenRow"
       columnClasses="colImg,colImg,colUser,colUser,colCustomer,colDescReassignedAct,colNumber,colNumber"
       styleClass="content" id="reassignedActsList">
       <h:column id="colImageurl">
       <f:facet name="header">
       <f:verbatim> </f:verbatim>
       </f:facet>
       <h:graphicImage value="#{reassAct.imageurl}"
       rendered="#{empty reassAct.endprocessing}" />
       <h:outputText rendered="#{!empty reassAct.endprocessing}">
       <f:verbatim> </f:verbatim>
       </h:outputText>
       </h:column>
       <h:column id="colRowSel">
       <f:facet name="header">
       <f:verbatim> </f:verbatim>
       </f:facet>
       <a4j:commandLink ajaxSingle="true"
       actionListener="#{reassignMonitorActivities.reassignedRowSelection}"
       reRender="actsToDrag">
       <a4j:actionparam name="selRow" value="#{rrkv}"></a4j:actionparam>
       <h:graphicImage styleClass="commandBtnImage"
       onclick="changeSelImg(this)"
       value="#{ (reassAct.selected==false) ? '/resources/rowPicker.gif' : '/resources/rowPickerSelected.gif'}"
       rendered="#{empty reassAct.endprocessing}" />
       </a4j:commandLink>
       </h:column>
       <h:column id="colUser">
       <f:facet name="header">
       <h:outputText value="#{msg.columnInboxUser}"></h:outputText>
       </f:facet>
       <h:outputText value="#{reassAct.iduser.fullname}" />
       </h:column>
       <h:column id="colReassignedUser">
       <f:facet name="header">
       <h:outputText value="#{msg.columnReassignedActionsNewUser}"></h:outputText>
       </f:facet>
       <h:outputText value="#{reassAct.reassignedOperator.user.fullname}" />
       </h:column>
       <h:column id="colCustomer">
       <f:facet name="header">
       <h:outputText value="#{msg.columnInboxCustomer}"></h:outputText>
       </f:facet>
       <h:outputText value="#{reassAct.customer.customername}" />
       </h:column>
      
       <h:column id="colDescription">
       <f:facet name="header">
       <h:outputText value="#{msg.columnInboxDescrizione}"></h:outputText>
       </f:facet>
       <h:outputText value="#{reassAct.description}" />
       </h:column>
      
       <h:column id="colDuration">
       <f:facet name="header">
       <h:outputText value="#{msg.columnInboxDuration}"></h:outputText>
       </f:facet>
       <h:outputText value="#{reassAct.duration}" />
       </h:column>
      
       <h:column id="colDifficulty">
       <f:facet name="header">
       <h:outputText value="#{msg.columnInboxDifficulty}"></h:outputText>
       </f:facet>
       <h:outputText value="#{reassAct.difficulty}" />
       </h:column>
       </rich:dataTable></div>
      
       </rich:simpleTogglePanel></div>
       </div>
       </a4j:form>
       </ui:define>
      </ui:composition>
      </html>
      

      As you can see, the user can drag an activity from left and drop it on desired operator to right. I developed a request bean which manages drop events, here's the code:
      package it.reedbusiness.mimesi.managedbeans;
      
      import it.reedbusiness.mimesi.persistence.TodayActivity;
      import it.reedbusiness.mimesi.persistence.User;
      import it.reedbusiness.mimesi.persistence.extensions.Operator;
      import it.reedbusiness.mimesi.utils.JSFUtil;
      
      import java.text.MessageFormat;
      import java.util.ArrayList;
      import java.util.HashSet;
      import java.util.Iterator;
      import java.util.List;
      import java.util.ResourceBundle;
      
      import javax.faces.application.Application;
      import javax.faces.application.FacesMessage;
      import javax.faces.context.FacesContext;
      
      import org.richfaces.component.html.HtmlDataTable;
      import org.richfaces.event.DropEvent;
      import org.richfaces.event.DropListener;
      
      public class ReassignDropListener extends DefaultRequestBean implements DropListener {
      
       private static final int SAME_OPERATOR_ERROR = 1;
       private static final int NOT_VALID_OPERATOR_ERROR = 2;
       private static final int NOT_VALID_OPERATOR_SENIORITY_ERROR = 3;
      
       public ReassignDropListener() {
       super();
       }
      
       public void processDrop(DropEvent event) {
      
       // HtmlScrollableDataTable sdt = (org.richfaces.component.html.HtmlScrollableDataTable)event.getComponent().getParent().getParent().getParent();
       HtmlDataTable sdt = (org.richfaces.component.html.HtmlDataTable) event.getComponent().getParent().getParent().getParent();
       // SimpleRowKey srk = (SimpleRowKey)sdt.getRowKey();
       // int opIndex = srk.intValue();
       int opIndex = sdt.getRowIndex();
      
       System.out.println("Drop event!!! \nNew Operator Index:" + opIndex);
      
       List<Operator> operators = sessionManager.getOperators();
       Operator operatorToReassign = operators.get(opIndex);
       ArrayList<TodayActivity> ras = sessionManager.getReassignActivitiesSelection();
      
       if (event.getDragValue() instanceof TodayActivity) {
       TodayActivity td = (TodayActivity) event.getDragValue();
       if (ras.indexOf(td) >= 0) {
       processMultiDrag(opIndex, ras, operatorToReassign, operators);
       } else {
       int errorType = 0;
       errorType = isReassignable(td, operatorToReassign);
       if (errorType == 0) {
       td.setReassignedOperator(operatorToReassign);
       operatorToReassign.increaseDuration(td);
       int originalOptIndex = getOperatorIndexByUser(operators, td.getIduser());
       operators.get(originalOptIndex).decreaseDuration(td);
      
       ArrayList<TodayActivity> ra = sessionManager.getReassignedActivities();
       if (ra == null) {
       ra = new ArrayList();
       }
       td.setSelected(false);
       ra.add(0, td);
       ra = null;
      
       List<TodayActivity> ata = sessionManager.getActivities();
       ata.remove(td);
      
       operators.set(opIndex, operatorToReassign);
      
       sessionManager.getReassignActivitiesSelection().remove(td);
      
       HashSet ajaxRowKeys = new HashSet();
       ajaxRowKeys.add(opIndex);
       sessionManager.setKeys(ajaxRowKeys);
       // sdt.setAjaxKeys(ajaxRowKeys);
       ajaxRowKeys = null;
       } else {
       FacesContext context = FacesContext.getCurrentInstance();
       FacesMessage message = new FacesMessage();
       message.setSummary(getErrorMessage(errorType, td));
       // message.setDetail("L'operatore scelto per la riassegnazione non ha un livello di seniority sufficiente per completare l'attività ");
       message.setSeverity(FacesMessage.SEVERITY_ERROR);
       context.addMessage(null, message);
       }
       }
       }
       // else if (event.getDragValue() instanceof ArrayList) {
       // processMultiDrag(event);
       // }
      
       }
      
       // public void processMultiDrag(DropEvent event) {
       public void processMultiDrag(int opIndex, ArrayList<TodayActivity> actsToReassing, Operator operatorToReassign, List<Operator> operators) {
       // HtmlDataTable sdt = (org.richfaces.component.html.HtmlDataTable) event.getComponent().getParent().getParent().getParent();
       // SimpleRowKey srk = (SimpleRowKey)sdt.getRowKey();
       // int opIndex = srk.intValue();
       // int opIndex = sdt.getRowIndex();
      
       // System.out.println("Operatore:" + opIndex);
       //
       // List<Operator> operators = sessionManager.getOperators();
       // Operator operatorToReassign = operators.get(opIndex);
      
       // ArrayList<TodayActivity> actsToReassing = (ArrayList<TodayActivity>) event.getDragValue();
       ArrayList<TodayActivity> ata = new ArrayList<TodayActivity>();
      
       int errorType = 0;
       Iterator<TodayActivity> it = actsToReassing.iterator();
       int originalOptIndex = 0;
      
       while (it.hasNext()) {
       TodayActivity td = (TodayActivity) it.next();
       errorType = isReassignable(td, operatorToReassign);
       if (errorType == 0) {
      
       td.setReassignedOperator(operatorToReassign);
       operatorToReassign.increaseDuration(td);
       originalOptIndex = getOperatorIndexByUser(operators, td.getIduser());
       operators.get(originalOptIndex).decreaseDuration(td);
       td.setSelected(false);
       ata.add(td);
       sessionManager.getReassignedActivities().add(0, td);
       sessionManager.getActivities().remove(td);
      
       } else {
       FacesContext context = FacesContext.getCurrentInstance();
       FacesMessage message = new FacesMessage();
       message.setSummary(getErrorMessage(errorType, td));
       // message.setDetail("L'operatore scelto per la riassegnazione non ha un livello di seniority sufficiente per completare l'attività ");
       message.setSeverity(FacesMessage.SEVERITY_ERROR);
       context.addMessage(null, message);
       }
       }
      
       operators.set(opIndex, operatorToReassign);
       sessionManager.getReassignActivitiesSelection().removeAll(ata);
       ata = null;
      
       }
      
       private int getOperatorIndexByUser(List<Operator> operators, User user) {
       Iterator<Operator> it = operators.iterator();
       int counter = 0;
       while (it.hasNext()) {
       Operator elem = (Operator) it.next();
       if (elem.getUser().equals(user)) {
       return counter;
       }
       counter++;
       }
       return 0;
       }
      
       private int isReassignable(TodayActivity td, Operator operatorToReassign) {
       int isReassignable = 0;
       int difficulty = td.getDifficulty().intValue();
       if (td.getIduser().getIduser() != operatorToReassign.getUser().getIduser()) {
       if (operatorToReassign != null && operatorToReassign.getSeniority() != null) {
       int seniority = new Integer(operatorToReassign.getSeniority()).intValue();
       if (difficulty == 1 && seniority == 1) {
       isReassignable = 0;
       } else if (difficulty == 2 && (seniority == 1 || seniority == 2)) {
       isReassignable = 0;
       } else if (difficulty == 3 && (seniority == 1 || seniority == 2 || seniority == 3)) {
       isReassignable = 0;
       } else {
       isReassignable = NOT_VALID_OPERATOR_SENIORITY_ERROR;
       }
       } else {
       isReassignable = NOT_VALID_OPERATOR_ERROR;
       }
       } else {
       isReassignable = SAME_OPERATOR_ERROR;
       }
       return isReassignable;
       }
      
       private String getErrorMessage(int errorType, TodayActivity td) {
       String errorMsg = null;
       ResourceBundle rb = JSFUtil.getResourceBundle();
       Object[] descriptionParameters = new Object[1];
       descriptionParameters[0] = td.getDescription();
       switch (errorType) {
       case 1:
       errorMsg = rb.getString("SAME_OPERATOR_ERROR");
       break;
      
       case 2:
       errorMsg = rb.getString("NOT_VALID_OPERATOR_ERROR");
       break;
      
       case 3:
       errorMsg = MessageFormat.format(rb.getString("NOT_VALID_OPERATOR_SENIORITY_ERROR"), descriptionParameters);
       break;
      
       default:
       break;
       }
      
       return errorMsg;
       }
      
       protected FacesContext getFacesContext() {
       return FacesContext.getCurrentInstance();
       }
      
       protected Application getApplication() {
       return FacesContext.getCurrentInstance().getApplication();
       }
      }
      

      As you can see into my bean's code, after the reassign process completes I get the list of activities to reassing from my session bean and remove the one reassigned.
      At the end of drop action I rerender the list of actities to reassign, the list of reassigned activites and the list of operators. my troubles start at this moment since, apparently without any criteria, the list of activites to reassign is not refreshed and I see again the reassigned activity, but sometime. (I'm not able to define in which cases) the list is rerendered correctly.
      For debugging purporse, I print on my log file the list of activities every time the application calls sessionManager.getActivities(). Following the output after a drop event is caught:

      Drop event!!!
      New Operator Index:1
      0 - Cliente:ELLA STUDIO descrizione: BELVITA (delivery alle 10:00)
      1 - Cliente:ELLA STUDIO descrizione: VILLA EDERA (delivery alle 10:00)
      2 - Cliente:ELLA STUDIO descrizione: HOTEL BELVEDERE RICCIONE (delivery alle 10:00)
      3 - Cliente:NAPER MULTIMEDIA descrizione: COPPA D ORO DELLE DOLOMITI (delivery alle 00:00)
      4 - Cliente:ELLA STUDIO descrizione: MUSEO DELLA BILANCIA (delivery alle 11:00)
      5 - Cliente:ACLI descrizione: temp (delivery non definita)
      6 - Cliente:_test descrizione: RUSSIZ SUPERIORE (delivery non definita)
      7 - Cliente:ELLA STUDIO descrizione: MONGOLFIERE INNAMORATE (delivery non definita)
      8 - Cliente:ELLA STUDIO descrizione: PARCO MATILDE (delivery non definita)
      9 - Cliente:VIVERE MILANO descrizione: GRAFFITI (delivery alle 11:00)
      10 - Cliente:GRUPPO TOSCANO descrizione: GRUPPO TOSCANO (delivery alle 11:00)
      11 - Cliente:ELLA STUDIO descrizione: GALLERIA SAN LUDOVICO (delivery alle 11:00)
      12 - Cliente:PRESS STUDIO descrizione: HSA (delivery alle 11:00)
      j_id3 - Sat Apr 12 13:48:50 CEST 2008 - Activities size:13
      
      
      0 - Cliente:ELLA STUDIO descrizione: VILLA EDERA (delivery alle 10:00)
      1 - Cliente:ELLA STUDIO descrizione: HOTEL BELVEDERE RICCIONE (delivery alle 10:00)
      2 - Cliente:NAPER MULTIMEDIA descrizione: COPPA D ORO DELLE DOLOMITI (delivery alle 00:00)
      3 - Cliente:ELLA STUDIO descrizione: MUSEO DELLA BILANCIA (delivery alle 11:00)
      4 - Cliente:ACLI descrizione: temp (delivery non definita)
      5 - Cliente:_test descrizione: RUSSIZ SUPERIORE (delivery non definita)
      6 - Cliente:ELLA STUDIO descrizione: MONGOLFIERE INNAMORATE (delivery non definita)
      7 - Cliente:ELLA STUDIO descrizione: PARCO MATILDE (delivery non definita)
      8 - Cliente:VIVERE MILANO descrizione: GRAFFITI (delivery alle 11:00)
      9 - Cliente:GRUPPO TOSCANO descrizione: GRUPPO TOSCANO (delivery alle 11:00)
      10 - Cliente:ELLA STUDIO descrizione: GALLERIA SAN LUDOVICO (delivery alle 11:00)
      11 - Cliente:PRESS STUDIO descrizione: HSA (delivery alle 11:00)
      j_id3 - Sat Apr 12 13:48:50 CEST 2008 - Activities size:12
      


      as you can see I print the operator's index on which I reassing the action and afterwards you see the list of the activities to reassing which should be redisplaied.
      the stange thing is that the method getActivites is called two times, the first one it returns all the activites including the one reassigned (why?), the second one it returns the activities list without the one reassigned (this is the right list), but my rich:datatable renders the first list (the wrong one), so renders a not correctly refreshed list.
      Are you able to give me some tips in order to get out from this terrible trouble?!?!

      I'm sorry form my very long post, but the issue is very complex to explain.
      please help me!!!
      Many thanks

      Cheers