Note that there are some explanatory texts on larger screens.

plurals
  1. POf:setPropertyActionListener passing the wrong value
    primarykey
    data
    text
    <p>the queer problem i'm facing is that my setpropertyActionListener passes the value of the previous Item rather than the current one after doing a search my list.</p> <p>here's my SSCCE : </p> <pre><code>&lt;rich:dataTable cellpadding="0" cellspacing="0" border="0" var="item" value="#{collaborateurBeans.list}" style="text-align:center;" rows="15" width="100%" styleClass="adminlist" rowClasses="row0,row1" columnsWidth="10,10,10,10,,,20,170,,115" reRender="ds" id="tableEntities"&gt; &lt;f:facet name="header"&gt; &lt;rich:columnGroup&gt; &lt;rich:column colspan="10"&gt; &lt;h:outputText value="Collaborateur(s) found(s): #{collaborateurBeans.size}" /&gt; &lt;/rich:column&gt; &lt;rich:column breakBefore="true"&gt; &lt;h:selectBooleanCheckbox id="checkAll" styleClass="headerText" value="" onclick="checkAll()" /&gt; &lt;/rich:column&gt; &lt;rich:column&gt; &lt;h:outputText styleClass="headerText" value="id" /&gt; &lt;/rich:column&gt; &lt;rich:column&gt; &lt;h:outputText styleClass="headerText" value="Trig" /&gt; &lt;/rich:column&gt; &lt;rich:column&gt; &lt;h:outputText styleClass="headerText" value="DAS" /&gt; &lt;/rich:column&gt; &lt;rich:column&gt; &lt;h:outputText styleClass="headerText" value="Prenom" /&gt; &lt;/rich:column&gt; &lt;rich:column&gt; &lt;h:outputText styleClass="headerText" value="Nom" /&gt; &lt;/rich:column&gt; &lt;rich:column&gt; &lt;h:outputText styleClass="headerText" value="Ligne de Service" /&gt; &lt;/rich:column&gt; &lt;rich:column&gt; &lt;h:outputText styleClass="headerText" value="E-mail" /&gt; &lt;/rich:column&gt; &lt;rich:column&gt; &lt;h:outputText styleClass="headerText" value="Statut" /&gt; &lt;/rich:column&gt; &lt;rich:column&gt; &lt;h:outputText styleClass="headerText" value="Action" /&gt; &lt;/rich:column&gt; &lt;/rich:columnGroup&gt; &lt;/f:facet&gt; &lt;rich:column&gt; &lt;h:selectBooleanCheckbox value="#{item.checked}" onclick="isChecked(this.checked)"&gt; &lt;/h:selectBooleanCheckbox&gt; &lt;/rich:column&gt; &lt;rich:column sortBy="#{item.iidcollaborateur}" sortOrder="DESCENDING" style="text-align:center"&gt; &lt;h:outputText value="#{item.iidcollaborateur}" /&gt; &lt;/rich:column&gt; &lt;rich:column filterBy="#{item.strTrigrammeCollaborateur}" filterEvent="onkeyup" style="padding-left:10px"&gt; &lt;h:outputText value="#{item.strTrigrammeCollaborateur}" /&gt; &lt;/rich:column&gt; &lt;rich:column filterBy="#{item.strDascollaborateur}" filterEvent="onkeyup" style="padding-left:10px"&gt; &lt;h:outputText value="#{item.strDascollaborateur}" /&gt; &lt;/rich:column&gt; &lt;rich:column filterBy="#{item.strPrenomCollaborateur}" filterEvent="onkeyup" style="padding-left:10px"&gt; &lt;h:outputText value="#{item.strPrenomCollaborateur}" /&gt; &lt;/rich:column&gt; &lt;rich:column filterBy="#{item.strNomCollaborateur}" filterEvent="onkeyup" style="padding-left:10px"&gt; &lt;h:outputText value="#{item.strNomCollaborateur}" /&gt; &lt;/rich:column&gt; &lt;rich:column filterBy="#{item.rrLigneservice.strLigneService}" filterEvent="onkeyup" style="padding-left:10px"&gt; &lt;h:outputText value="#{item.rrLigneservice.strLigneService}" /&gt; &lt;/rich:column&gt; &lt;rich:column filterBy="#{item.strEmailCollaborateur}" filterEvent="onkeyup" style="padding-left:10px"&gt; &lt;h:outputText value="#{item.strEmailCollaborateur}" /&gt; &lt;/rich:column&gt; &lt;rich:column filterBy="#{item.rrStatutcollaborateur.strLibelleStatutCollaborateur}" filterEvent="onkeyup" style="padding-left:10px"&gt; &lt;h:outputText value="#{item.rrStatutcollaborateur.strLibelleStatutCollaborateur}" style='width:100%;display:block;height:15px; background-color:#{item.rrStatutcollaborateur.strCouleur == "" ? "" :item.rrStatutcollaborateur.strCouleur}'/&gt; &lt;/rich:column&gt; &lt;rich:column style="text-align:center"&gt; &lt;a4j:commandLink id="tooltip"&gt; &lt;h:graphicImage value="../images/actions/tooltip.png" style="border:0px;padding-right:5px" alt="view"&gt; &lt;/h:graphicImage&gt; &lt;/a4j:commandLink&gt; &lt;rich:toolTip for="tooltip" showDelay="300" direction="top-left" styleClass="tooltip" layout="block"&gt; &lt;a4j:outputPanel layout="block"&gt; &lt;h:panelGrid columns="4"&gt; &lt;f:facet name="header"&gt; &lt;h:outputText value="Collaborateur Détails:" style="text-align:center;"/&gt; &lt;/f:facet&gt; &lt;h:outputText value="Collaborateur :" /&gt; &lt;h:outputText value="#{item.strNomCollaborateur} #{item.strPrenomCollaborateur}" styleClass="tooltipData" /&gt; &lt;h:outputText value="DAS :" /&gt; &lt;h:outputText value="#{item.strDascollaborateur}" styleClass="tooltipData" /&gt; &lt;h:outputText value="Date Naissnace : " styleClass="tooltipData" /&gt; &lt;h:outputText value="#{item.dtDateNaissanceCollaborateur}" styleClass="tooltipData" &gt; &lt;f:convertDateTime pattern="dd/MM/yyyy" type="date" timeZone="Europe/Paris"/&gt; &lt;/h:outputText&gt; &lt;h:outputText value="Adresse :" /&gt; &lt;h:outputText value="#{item.strAdresseCollaborateur}" styleClass="tooltipData" /&gt; &lt;h:outputText value="Email :" /&gt; &lt;h:outputText value="#{item.strEmailCollaborateur}" styleClass="tooltipData" /&gt; &lt;h:outputText value="Télephone :" /&gt; &lt;h:outputText value="#{item.strTelephoneProfessionelCollaborateur}" styleClass="tooltipData" /&gt; &lt;h:outputText value="Etage :" /&gt; &lt;h:outputText value="#{item.strEtageCollaborateur}" styleClass="tooltipData" /&gt; &lt;h:outputText value="Bureau :" /&gt; &lt;h:outputText value="#{item.strBureauCollaborateur}" styleClass="tooltipData" /&gt; &lt;h:outputText value="Ligne de Service :" /&gt; &lt;h:outputText value="#{item.rrLigneservice.strLigneService}" styleClass="tooltipData" /&gt; &lt;h:outputText value="Responsable :" /&gt; &lt;h:outputText value="#{item.rrCollaborateur.strNomCollaborateur} #{item.rrCollaborateur.strPrenomCollaborateur}" styleClass="tooltipData" /&gt; &lt;h:outputText value="Date D'Arrivé prévue :" /&gt; &lt;h:outputText value="#{item.dtDateArriveePrevueCollaborateur}" styleClass="tooltipData" &gt; &lt;f:convertDateTime pattern="dd/MM/yyyy" type="date" timeZone="Europe/Paris"/&gt; &lt;/h:outputText&gt; &lt;h:outputText value="Date De Sortie Prévue :" /&gt; &lt;h:outputText value="#{item.dtDateSortiePrevueCollaborateur}" styleClass="tooltipData"&gt; &lt;f:convertDateTime pattern="dd/MM/yyyy" type="date" timeZone="Europe/Paris"/&gt; &lt;/h:outputText&gt; &lt;h:outputText value="Date D'Arrivé Réelle :" /&gt; &lt;h:outputText value="#{item.dtDateArriveReelleCollaborateur}" styleClass="tooltipData"&gt; &lt;f:convertDateTime pattern="dd/MM/yyyy" type="date" timeZone="Europe/Paris"/&gt; &lt;/h:outputText&gt; &lt;h:outputText value="Date De Sortie Réelle :" /&gt; &lt;h:outputText value="#{item.dtDateSortieReelleCollaborateur}" styleClass="tooltipData"&gt; &lt;f:convertDateTime pattern="dd/MM/yyyy" type="date" timeZone="Europe/Paris"/&gt; &lt;/h:outputText&gt; &lt;h:outputText value="Niveau :" /&gt; &lt;h:outputText value="#{item.rrNiveau.strLibelleNiveau}" styleClass="tooltipData" /&gt; &lt;h:outputText value="Code D'Emploi :" /&gt; &lt;h:outputText value="#{item.rrCodeemploi.strLibelleCodeEmploi}" styleClass="tooltipData" /&gt; &lt;h:outputText value="Fonction :" /&gt; &lt;h:outputText value="#{item.rrFonction.strTitreFonction}" styleClass="tooltipData" /&gt; &lt;h:outputText value="Statut :" /&gt; &lt;h:outputText value="#{item.rrStatutcollaborateur.strLibelleStatutCollaborateur}" styleClass="tooltipData" /&gt; &lt;/h:panelGrid&gt; &lt;/a4j:outputPanel&gt; &lt;/rich:toolTip&gt; &lt;h:commandLink action="#{collaborateurBeans.redirectEdit}" title="editer" onclick="blur();"&gt; &lt;h:graphicImage value="../images/actions/edit.png" style="border:0px;padding-right:5px" alt="Edit" /&gt; &lt;f:setPropertyActionListener value="#{item}" target="#{suiviBridgeBean.collaborateur}" /&gt; &lt;f:setPropertyActionListener value="#{item}" target="#{collaborateurBeans.currentItem}"/&gt; &lt;/h:commandLink&gt; &lt;h:commandLink action="#{collaborateurBeans.redirectSuivi}" title="ajouter suivi" onclick="blur();"&gt; &lt;h:graphicImage value="../images/actions/suivi.png" style="border:0px;padding-right:5px" alt="Suivi"/&gt; &lt;f:setPropertyActionListener value="#{item}" target="#{suiviBridgeBean.collaborateur}" /&gt; &lt;/h:commandLink&gt; &lt;h:commandLink action="#{collaborateurBeans.redirectDetail}" title="Détail des affectations" onclick="blur();"&gt; &lt;h:graphicImage value="../images/actions/detailed.png" style="border:0;padding-right:5px" alt="Détail" /&gt; &lt;f:setPropertyActionListener value="#{item}" target="#{benchBridgeBean.rrCollaborateur}" /&gt; &lt;/h:commandLink&gt; &lt;h:commandLink action="#{collaborateurBeans.deleteItem}" title="supprimer" onclick="blur();if(!confirm('voulez-vous supprimer le collaborateur selectionné ?')) return false;"&gt; &lt;h:graphicImage value="../images/actions/delete.png" style="border:0" alt="Delete" /&gt; &lt;f:setPropertyActionListener value="#{item}" target="#{collaborateurBeans.currentItem}" /&gt; &lt;/h:commandLink&gt; &lt;/rich:column&gt; &lt;f:facet name="footer"&gt; &lt;rich:datascroller id="ds" renderIfSinglePage="false" maxPages="10" page="1" onclick="ajaxStart()" oncomplete="ajaxStop()" ajaxSingle="true"&gt;&lt;/rich:datascroller&gt; &lt;/f:facet&gt; &lt;/rich:dataTable&gt; </code></pre> <p>my backing bean :</p> <pre><code>public class CollaborateurBeans extends MsgBox { private CollaborateurManager collaborateurManager;// contrat de service private List&lt;RrCollaborateur&gt; list;// Liste des collaborateurs utilisé meme // dans la recherche private List&lt;RrCollaborateur&gt; listAll;// affiche tout les collaborateurs private NiveauCodeEmploiManager niveauCodeEmploiManager;// contrat de // service private List&lt;RrNiveaucodeemploi&gt; listNiveau;// List niveau correspondant à // un code emloi private RrCollaborateur currentItem;// Ligne selectionnées // ** Attribut de recherche **// private RrCollaborateur collaborateurSearch;// info sur collaborateur private Date dtArriveeReelleLo; private Date dtArriveeReelleHi; private Date dtSortieReelleLo; private Date dtSortieReelleHi; // ** **// private Integer idResponsable = 0;// Id du responsable du collaborateur public CollaborateurBeans() { collaborateurManager = (CollaborateurManager) ApplicationContext .getApplicationContext().getBean("collaborateurManager"); niveauCodeEmploiManager = (NiveauCodeEmploiManager) ApplicationContext .getApplicationContext().getBean("niveauCodeEmploiManager"); currentItem = new RrCollaborateur(); collaborateurSearch = new RrCollaborateur(); // initialisation des messages super.msgError = null; super.msgSuccess = null; } public String redirectEdit() { if (currentItem.getRrCollaborateur() != null) idResponsable = currentItem.getRrCollaborateur() .getIidcollaborateur(); return "success"; } } </code></pre> <p>the probleme occurs in this line </p> <pre><code>&lt;f:setPropertyActionListener value="#{item}" target="#{collaborateurBeans.currentItem}"/&gt; &lt;/h:commandLink&gt; </code></pre> <p>the item is the current item in the datatable , everything works well when i try to edit a row , but when i search and retreive another list with a more limited size , the setProperty action listenr passes the item of the previous list , i realy don't know how that happens because </p> <pre><code>&lt;h:outputText value="#{item.iidcollaborateur}" styleClass="tooltipData" /&gt; </code></pre> <p>displays the right Id.</p> <p>even after rerendering my dataTable it still passes the id's of the previous list result. i realy don't get it . my backBean's scope is "request" .</p> <p>any thoughts?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload