0 Replies Latest reply on Jun 5, 2008 2:29 PM by john_hedden

    dataTable and reRender

    john_hedden

      Ive got 2 dataTables. One is a list of selected options and the other is a list of possible options backed by a framework:entity-query. When a possible option is selected via "onRowClick" it is added to selected options and should be removed from possible options.

      Now, if I select possible option 1, it gets listed in selected options but is still in possible options, which is not what i want. If i then select possible option 2 it gets populated in selected list and option 1 now disappears from option list.

      Its like its a step behind. Almost like reRender for option List happens before framework:entity-query executes.

      Any ideas?

      dataTable of selections

      <a:outputPanel id="processListPanel">
       <rich:dataTable onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
       onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
       value="#{environment.processList}" var="selected" id="selectedList" rows="20"
       rendered="#{not empty environment.processList}" width="100%">
       <f:facet name="header">Selected Process List</f:facet>
       <rich:column sortBy="#{selected.activationProcess.processName}">
       <f:facet name="header">Process Name</f:facet>
       <h:outputText value="#{selected.activationProcess.processName}" />
       </rich:column>
       <rich:column sortBy="#{selected.activationProcess.automationLevel}">
       <f:facet name="header">Automation Level</f:facet>
       <h:outputText value="#{selected.activationProcess.automationLevel}" />
       </rich:column>
       </rich:dataTable>
       </a:outputPanel>
      


      dataTable of options
      <a:outputPanel id="processOptionPanel">
       <h:panelGrid columns="1" width="600px">
       <rich:dataTable onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
       onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
       value="#{activationProcesses.resultList}" var="option" id="optionList" rows="35"
       width="100%">
       <f:facet name="header">Process Option List</f:facet>
       <rich:column sortBy="#{option.activationProcessCategory.categoryName}">
       <f:facet name="header">Category</f:facet>
       <h:outputText value="#{option.activationProcessCategory.categoryName}" />
       </rich:column>
       <rich:column sortBy="#{option.processName}">
       <f:facet name="header">Process Name</f:facet>
       <h:outputText value="#{option.processName}" />
       </rich:column>
       <rich:column sortBy="#{option.automationLevel}">
       <f:facet name="header">Automation Level</f:facet>
       <h:outputText value="#{option.automationLevel}" />
       </rich:column>
       <a:support event="onRowClick" action="#{activationManager.addProcess()}"
       reRender="processOptionPanel, processListPanel, processMessagePanel">
       <f:param name="optionId" value="#{option.id}" />
       </a:support>
       </rich:dataTable>
       </h:panelGrid>
       </a:outputPanel>


      entity-query
      <framework:entity-home name="activationProcessHome" entity-class="net.opsource.ooord.model.ActivationProcess"/>
       <factory name="activationProcess" value="#{activationProcessHome.instance}"/>
       <framework:entity-query name="activationProcesses"
       ejbql="SELECT a FROM ActivationProcess a LEFT JOIN FETCH a.environmentActivationProcessList b LEFT JOIN FETCH b.environment c WHERE b.id IS NULL">
       <framework:restrictions>
       <value>c.id = #{environment.id}</value>
       </framework:restrictions>
       </framework:entity-query>