Décider ce que l'on envoie avec a4j
Bonjour,
J'ai une page qui contient plusieurs tableaux. J'ai un bouton "+" qui me permet d'ajouter une ligne. Cette action ce fait en en Ajax avec a4j. J'ai mis une région autour de mon tableau pour ne décoder que les informations nécessaires. Cependant la requête Ajax envoi toutes les informations de la page. Ma page étant assez lourde la durée de la phase APPLY_REQUEST_VALUES du cylce est assez longue (< 3s).
Peux t-on limiter les informations envoyé dans la requête Ajax?
Voici le code de ma page:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html 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:t="http://myfaces.apache.org/tomahawk"
xmlns:s="http://myfaces.apache.org/sandbox"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:a="http://www.astek.fr/jsfComponents">
<ui:composition>
<a4j:region id="ajaxRegion" selfRendered="true" renderRegionOnly="true">
<a4j:outputPanel id="panelTableauFDS" ajaxRendered="true">
<t:dataTable value="#{datas.lignes}" var="row" id="tableauFDS"
styleClass="tableau_fiche" style="width:100%" rowClasses="ligneImpaire,lignePaire">
<t:columns value="#{datas.colonnes}" var="question"
styleClass="conteneurInputTableau"
width="#{question.tailleHtml}"
headerstyleClass="#{(datas.colonnes.rowCount == question.ordre
and (clos or forceDisable or (not forceEnable
and not cm and datas.disableForUserRole)))?'lastTh':''}"
>
<f:facet name="header" >
<h:outputText value="#{question.libelle}"/>
</f:facet>
<a:question reponse="#{datas.columnValue}"
export="#{export}"
inactif="#{empty ficheController.model.formulaire
or ficheController.model.formulaire.idForm != datas.idForm
or ficheController.model.numLigne != row
or (clos or forceDisable or (not forceEnable and not cm and datas.disableForUserRole))}"
tableau="true" />
<f:facet name="footer">
<!-- Ajouter la ligne-->
<t:div rendered="#{not question.firstColumn and (not (clos or forceDisable or
(not forceEnable and not cm and datas.disableForUserRole)))}">
<a4j:commandButton
id="ajoutLigne"
image="/images/common/add.gif"
title="Ajouter une nouvelle ligne"
styleClass="bntAjoutFds"
actionListener="#{ficheController.ajoutLigne}"
rendered="#{not(clos or forceDisable or (not forceEnable and not cm and datas.disableForUserRole))}"
style="display:block;text-align:left;"
reRender="tableauFDS"
ajaxSingle="true"
>
<a4j:actionparam name="idFormulaire" value="#{paragraphe.idForm}"
assignTo="#{ficheController.model.idForm}"/>
</a4j:commandButton>
</t:div>
</f:facet>
</t:columns>
<t:column rendered="#{not (clos or forceDisable or (not forceEnable and not cm and datas.disableForUserRole))}"
style="text-align:center"
width="1px">
<!-- Edition de la ligne -->
<t:commandButton
id="editerLigne"
image="/images/common/modif.gif"
title="Editer"
actionListener="#{ficheController.editerLigne}"
rendered="#{empty ficheController.model.formulaire
and ficheController.model.formulaire.idForm != datas.idForm
and ficheController.model.numLigne != row
and not (clos or forceDisable or (not forceEnable and not cm and datas.disableForUserRole))}"
>
<t:updateActionListener
property="#{ficheController.model.formulaire}"
value="#{paragraphe}" />
<t:updateActionListener
property="#{ficheController.model.numLigne}" value="#{row}" />
</t:commandButton>
<!-- enreg de la ligne -->
<t:commandButton
id="modifierLigne"
image="/images/common/save15.png"
title="Enregistrer"
action="#{ficheController.enregistreReponsesTableau}"
rendered="#{ficheController.model.formulaire.idForm == datas.idForm
and ficheController.model.numLigne == row
and not (clos or forceDisable or (not forceEnable and not cm and datas.disableForUserRole))}">
</t:commandButton>
</t:column>
<t:column rendered="#{not (clos or forceDisable or (not forceEnable and not cm and datas.disableForUserRole))}"
headerstyleClass="lastTh"
style="text-align:center"
width="1px">
<!-- Suppression de la ligne -->
<t:commandButton
id="supprimerLigne"
title="Supprimer"
image="/images/common/button_cancel.gif"
rendered="#{empty ficheController.model.formulaire
and ficheController.model.formulaire.idForm != datas.idForm
and ficheController.model.numLigne != row
and not (clos or forceDisable or
(not forceEnable and not cm and datas.disableForUserRole))}"
actionListener="#{ficheController.SupprLigneTableau}">
<t:updateActionListener
property="#{ficheController.model.formulaire}"
value="#{paragraphe}" />
<t:updateActionListener
property="#{ficheController.model.numLigne}" value="#{row}" />
</t:commandButton>
<!-- annulation des modifications de la ligne -->
<t:commandButton
image="/images/common/cancel_16x16.gif"
title="Annuler"
action="#{ficheController.annulerModification}"
rendered="#{ficheController.model.formulaire.idForm == datas.idForm
and ficheController.model.numLigne == row
and not (clos or forceDisable or (not forceEnable and not cm and datas.disableForUserRole))}">
</t:commandButton>
</t:column>
</t:dataTable>
</a4j:outputPanel>
</a4j:region>
</ui:composition>
</html> |
Merci d'avance