This content has been marked as final.
Show 9 replies
-
1. Re: Filtering datatable and getRowData
nbelaevski Feb 12, 2009 6:53 PM (in response to toomtooms)Hello,
What RF version do you use? -
2. Re: Filtering datatable and getRowData
toomtooms Feb 13, 2009 3:19 AM (in response to toomtooms)3.3.0.GA
-
3. Re: Filtering datatable and getRowData
konstantin.mishin Feb 13, 2009 10:54 AM (in response to toomtooms)Hello toomtooms.
Description of your problem is very short. Post your page and bean code, please. -
4. Re: Filtering datatable and getRowData
toomtooms Feb 13, 2009 12:43 PM (in response to toomtooms)Sorry.
Here is my page :<h:form id="frmTable"> <rich:dataTable binding="#{ManageUsers.table}" onRowMouseOver="this.style.backgroundColor='#C8DC01'" onRowMouseOut="this.style.backgroundColor='#{org.richfaces.SKIN.tableBackgroundColor}'" onRowClick="this.style.backgroundColor='#F1F1F1'" width="100%" id="tbl" value="#{ManageUsers.users}" var="u"> <f:facet name="header"> <rich:columnGroup> <rich:column> <h:outputText value="Nom" /> </rich:column> <rich:column> <h:outputText value="Prénom" /> </rich:column> <rich:column> <h:outputText value="Modifier" /> </rich:column> <rich:column> <h:outputText value="Supprimer" /> </rich:column> </rich:columnGroup> </rich:columnGroup> </f:facet> <rich:column id="nom" styleClass="columnNom" filterMethod="#{ManageUsers.filterNom}"> <f:facet name="header"> <h:inputText id="filterNomInput" value="#{ManageUsers.filterNomValue}" styleClass="filterNom"> <a4j:support event="onkeyup" ignoreDupResponses="true" requestDelay="700" reRender="tbl" oncomplete="setCaretToEnd(event);"> </a4j:support> </h:inputText> </f:facet> <h:outputText value="#{u.nom}" /> </rich:column> <rich:column id="prenom" styleClass="columnPrenom" filterMethod="#{ManageUsers.filterPrenom}"> <f:facet name="header"> <h:inputText id="filterPrenomInput" value="#{ManageUsers.filterPrenomValue}" styleClass="filterPrenom"> <a4j:support event="onkeyup" ignoreDupResponses="true" requestDelay="700" reRender="tbl" oncomplete="setCaretToEnd(event);"> </a4j:support> </h:inputText> </f:facet> <h:outputText value="#{u.prenom}" /> </rich:column> <rich:column styleClass="columnModifier"> <a4j:commandLink id="editLink" reRender="panelFormUser" actionListener="#{ManageUsers.editAction}" oncomplete="#{rich:component('panelFormUser')}.show()"> <h:graphicImage style="border:0" url="images/edit.gif" /> </a4j:commandLink> </rich:column> <rich:column styleClass="columnSupprimer"> <h:graphicImage style="border:0;cursor:pointer;" url="images/delete.gif" onclick="#{rich:component('panelConfirmDelete')}.show()" /> <rich:modalPanel id="panelConfirmDelete" width="250" height="115" resizeable="false"> <f:facet name="header"> <h:outputText value="Confirmation"></h:outputText> </f:facet> <div style="text-align: center;font-size:10pt;"> <h:outputText value="Etes-vous sûr de vouloir supprimer ce covoitureur ?"></h:outputText> <br /> <br /> <a4j:commandButton value=" OK " actionListener="#{ManageUsers.deleteAction}" reRender="tbl,panelFormUser"></a4j:commandButton> <a4j:commandButton value="Annuler" onclick="#{rich:component('panelConfirmDelete')}.hide()"></a4j:commandButton> </div> </rich:modalPanel> </rich:column> </rich:dataTable> </h:form>
and my action :public void editAction(ActionEvent e) { User user = (User) table.getRowData(); ... }
For example, if I click on the first row of my filtered table, I get data of the first row of the original table.
Is it clear ? Do you need more information ? -
5. Re: Filtering datatable and getRowData
konstantin.mishin Feb 16, 2009 9:14 AM (in response to toomtooms)What scope bean "ManageUsers" has?
-
6. Re: Filtering datatable and getRowData
toomtooms Feb 16, 2009 3:16 PM (in response to toomtooms)request
but I tried with to put it in session and it works !
Thank you -
7. Re: Filtering datatable and getRowData
konstantin.mishin Feb 17, 2009 5:54 AM (in response to toomtooms)It's good.
But I recommend not to use binding a component as a property of a class with session scope. -
8. Re: Filtering datatable and getRowData
toomtooms Feb 26, 2009 12:53 PM (in response to toomtooms)because of its size ?
-
9. Re: Filtering datatable and getRowData
nbelaevski Feb 26, 2009 6:01 PM (in response to toomtooms)No. It's not recommended to store components in session scope because this may produce unwanted effects (multi threading quirks, incorrect state etc. issues)