[closed]DataTable with Filter actionlistener not working

UI Components for JSF
Post Reply
GeraldVonRiva
Posts: 9
Joined: 30 Sep 2016, 10:26

26 Oct 2016, 14:47

Hello i have a DataTable with a commandButton on the last Column in every Row. The CommandButton call a Method in a SessionScoped Bean over actionListener. When i add the Filtering function for my DataTable, the CommandButton is not working anymore. The JavaMethods in Bean are not called.

xhtml Page

Code: Select all

    <ui:composition>   
     
        <p:dialog id="dlg" widgetVar="dlg" modal="true" appendTo="@(body)" header="pwd change">
            <ui:include src="../tmp/dlg_temp.xhtml" />
            <p:ajax event="close" listener="#{bean2.Close}" update=":Table" />
        </p:dialog>
        
        <h:outputLabel value="hello" />
            <br/>
            <br/>
            <h:form id="Table" style="width: 100%">
                <p:dataTable id="dt_cont" 
                             var="cont" 
                             value="#{bean1.alcontList}"
                            [b] emptyMessage="no records"
                             filteredValue="#{bean1.filteredRows}"[/b]
                             rows="10" 
                             paginator="true"
                             paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" 
                             rowsPerPageTemplate="10,20"
                             paginatorPosition="bottom"
                             style="width: auto; height: auto">
                                     
                    <p:columns value="#{bean1.alcontHeader}" var="column" columnIndexVar="colIn" style="width: auto" [b]filterBy="#{cont[colIn]}" filterMatchMode="contains"[/b]>
                        <f:facet name="header">
                            <h:outputText value="#{column}" style="width: auto"/>
                        </f:facet>
                                                
                        <h:outputText value="#{cont[colIn]}"/>
  
                    </p:columns>
                    
                    <p:column style="width:32px;text-align: center">
                        
                        <p:commandButton icon="ui-icon-search" title="select" oncomplete="PF('dlg').show();"  actionListener="#{bean2.initDialog('dlg')}" >
                            
                            <f:setPropertyActionListener value="#{cont}" target="#{bean2.alSeleData}" />
                                                       
                        </p:commandButton>
                        
                    </p:column>
                                  
                </p:dataTable>
            
            </h:form>
    </ui:composition>
    


when i delete the filterproperties the site runs well.

Any Tips?

greeting

Gerald
Last edited by GeraldVonRiva on 27 Oct 2016, 14:55, edited 1 time in total.
PrimeFaces: 6.0
Server: Wildfly 10.0.0

GeraldVonRiva
Posts: 9
Joined: 30 Sep 2016, 10:26

27 Oct 2016, 14:54

problem solved. The Problem was the SessionScoped Bean. My Second Table in an other Page, had the FilterValues from the First Table. I Changes SessionScoped to ViewScoped.
PrimeFaces: 6.0
Server: Wildfly 10.0.0

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 59 guests