Issue Ajax Richfaces 3.3.3
ci_talha Nov 22, 2013 3:55 AMHello,
I have a form with two components: a tree projects with their phases (rich:tree) and an array of resources (rich:dataTable) allocated to the project selected in the tree.
When I make a filter in the table, the whole tree is refreshed, I do not understand why ?
Is there a way (ajax I suppose) to separate the tree of the table, ie when I filter by a column, the tree will not charge?
here is my code :
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich"
xmlns:a="http://richfaces.org/a4j"
template="layout/template.xhtml">
<ui:define name="body">
<h:form id="ProjectManagerForm">
<rich:tabPanel>
<rich:tab label="Gestion Projets" switchType="ajax" immediate="true">
<rich:tree id="idTree" switchType="client" reRender="PlanningProjectPanel" rendred="true" value="#{ArbreProjetsBean.root}" var="item" ajaxSubmitSelection="true" nodeSelectListener="#{PlanningProjectsBean.onSelectNodeProjet}" adviseNodeOpened="#{ArbreProjetsBean.getAdviseNode()}" selectedClass="tree-node-selected">
<rich:treeNode style="cursor:pointer">
<h:outputText value="#{item}" style="cursor:pointer"/>
</rich:treeNode>
</rich:tree>
<rich:panel id="PlanningProjectPanel" style="border:10px;">
<rich:dataTable id="humRess" reRender="ds" value="#{AllRessourcesHumaines.getAllResshum()}" var="ressource" rows="5" rowKeyVar="row" onkeypress="if (event.keyCode == 13) {document.getElementById('ProjectManagerForm:PlanningProjectForm:humRess').blur(); return false;} else {return true;}"
onRowContextMenu="if (row) row.style.backgroundColor='#{aSkin.tableBackgroundColor}'; this.style.backgroundColor='#F1F1F1'; row=this; return false;"
onRowMouseOver="this.style.backgroundColor='#F8F8F8'"
onRowMouseOut="this.style.backgroundColor='#{aSkin.tableBackgroundColor}'">
<f:facet name="header">
<h:outputText value="Affectation des Ressources Humaines" />
</f:facet>
<rich:column style="xls-column-export:false;" sortBy="#{ressource.acronyme}" filterBy="#{ressource.acronyme}" filterEvent="onkeyup">
<f:facet name="header"><h:outputText value="Acronyme" /></f:facet>
<h:outputText value="#{ressource.acronyme}" />
</rich:column>
<rich:column sortBy="#{ressource.nomrh} #{ressource.prenomrh}" filterBy="#{ressource.nomrh} #{ressource.prenomrh}" filterEvent="onkeyup">
<f:facet name="header"><h:outputText value="Nom et prénom" /></f:facet>
<h:outputText value="#{ressource.nomrh} #{ressource.prenomrh}" />
</rich:column>
<rich:column sortBy="#{ressource.diplome.lbldiplome}" filterBy="#{ressource.diplome.lbldiplome}" filterEvent="onkeyup">
<f:facet name="header"><h:outputText value="Dernier Diplôme" /></f:facet>
<h:outputText value="#{ressource.diplome.lbldiplome}" />
</rich:column>
<rich:column style="xls-column-export:false; text-align: center;" >
<f:facet name="header">
<h:outputText value="Affectation" />
</f:facet>
<a:commandLink styleClass="no-decor" reRender="editGrid" execute="@this" oncomplete="#{rich:component('pannelAffectationRessource')}.show()">
<h:graphicImage value="/img/icons/edit.gif" alt="Affecter" />
<f:setPropertyActionListener target="#{UpdatePhaseBean.idSelectedRH}" value="#{ressource.idress}" />
<f:setPropertyActionListener target="#{UpdatePhaseBean.prenomSelectedRH}" value="#{ressource.prenomrh}" />
<f:setPropertyActionListener target="#{UpdatePhaseBean.nomSelectedRH}" value="#{ressource.nomrh}" />
</a:commandLink>
</rich:column>
<f:facet name="footer">
<rich:datascroller id="ds" renderIfSinglePage="false" for="humRess" />
</f:facet>
</rich:dataTable>
</rich:panel>
</rich:tab>
</rich:tabPanel>
</h:form>
</ui:define>
</ui:composition>