4 Replies Latest reply: Mar 2, 2009 1:07 AM by gopi b RSS

Problem with Filters with datatable in Rich Faces

gopi b Newbie

Hi

I have four data tables under different tabs (Rich Tab Panel) in <a4j:form>. I am using filters for each of the four data tables, the problem I am facing is filters are working fine for only the first data table in the <a4j:form>, but filters in the remaining three data tables are not working.

Thanks in Advanced.

  • 1. Re: Problem with Filters with datatable in Rich Faces
    Nick Belaevski Master

    Hello,

    Please post full page code.

  • 2. Re: Problem with Filters with datatable in Rich Faces
    gopi b Newbie

    <!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" xmlns:a4j="http://richfaces.org/a4j"
    template="/layout/mainTemplate.xhtml">

    <ui:define name="innerbody">
    <ui:include src="../stylesheet/defaultStyles.css" />
    <s:cache key="0" region="table" enabled="false"></s:cache>
    <a4j:form id="CustomerForm" enctype="multipart/form-data"
    ajaxSubmit="true"
    style="padding-top:2% ; padding-left:2% ;vertical-align: top; padding-right:5%">
    <h:messages globalOnly="true" styleClass="message"
    style="border: 1px solid #FFCC00;
    padding: 5px; margin-top: 5px; margin-bottom: 5px; background-color: #F0F8FF; font-size: 12px;" />

    <rich:panel headerClass="headerFont" style="border:none;">

    <rich:tabPanel id="table" switchType="client"
    headerClass="headerFont">
    <rich:tab label="Pending Calls(#{pendingCallList.resultList.size})">
    <rich:panelBar height="100%" width="100%">
    <rich:panelBarItem
    label="Pending Complaints(#{pendingCallList.resultList.size})">
    <h:outputText
    value="There are No Pending Calls exists"
    rendered="#{empty pendingCallList.resultList}" /> <h:form
    id="pendingCallForm">
    <rich:datascroller align="center" for="pendingCallList"
    maxPages="2000" renderIfSinglePage="false"
    rendered="#{not empty pendingCallList.resultList}" />
    <rich:spacer
    rendered="#{not empty pendingCustomerList.resultList}" />
    <rich:dataTable id="pendingCallList" var="calls"
    value="#{pendingCallList.resultList}"
    rendered="#{not empty pendingCallList.resultList}" rows="6"
    rowClasses="#{tableLnF.getRowSettings(skinBean.skin)}"
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}"
    columnClasses="formFont2">
    <f:facet name="header">
    <rich:columnGroup>
    <rich:column
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}">
    <h:outputText value="Complaint No." />
    </rich:column>
    <rich:column
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}">
    <h:outputText value="Customer Name" />
    </rich:column>
    <rich:column
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}">
    <h:outputText value="Contact Number" />
    </rich:column>
    <rich:column
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}">
    <h:outputText value="Complaint On" />
    </rich:column>
    <rich:column
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}">
    <h:outputText value="Complaint Description" />
    </rich:column>
    <rich:column
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}">
    <h:outputText value="Applied On" />
    </rich:column>
    <rich:column
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}">
    <h:outputText value="Next Step Pending" />
    </rich:column>
    </rich:columnGroup>
    </f:facet>

    <rich:column align="center" sortable="true"
    filterBy="#{calls.call_ID}" filterEvent="onkeyup">
    #{calls.call_ID}
    </rich:column>

    <rich:column align="center" filterBy="#{calls.customerName}"
    filterEvent="onkeyup">

    <h:outputText value="#{calls.customerName}">
    </h:outputText>
    </rich:column>
    <rich:column align="center">
    #{calls.contactNumber}
    </rich:column>

    <rich:column align="center">
    #{calls.complaintNo.complaintType}
    </rich:column>
    <rich:column align="center">
    <h:outputText value="#{clcalls.complaintNo.complaintDesc}"
    rendered="#{clcalls.complaintNo.complaintDesc ne null}"></h:outputText>
    <h:outputText value=" N/A "
    rendered="#{clcalls.complaintNo.complaintDesc eq null}"></h:outputText>
    </rich:column>

    <rich:column>
    <h:outputText value="#{calls.createdOn}">
    <s:convertDateTime type="date" pattern="dd/MMM/yyyy" />
    </h:outputText>
    </rich:column>
    <rich:column>
    <h:outputText
    value="#{taskConditions.getNextPendingTask('', calls.call_ID)}"></h:outputText>
    </rich:column>
    </rich:dataTable>

    </h:form>
    </rich:panelBarItem>

    <rich:panelBarItem
    label="Pending Requests(#{pendingRequestDetails.resultList.size})">

    <h:outputText
    value="There are No Pending Requests exists"
    rendered="#{empty pendingRequestDetails.resultList}" /> <h:form
    id="pendingRequestsForm">
    <rich:datascroller align="center" for="pendingRequestDetails"
    maxPages="2000"
    rendered="#{not empty pendingRequestDetails.resultList}" />
    <rich:spacer
    rendered="#{not empty pendingRequestDetails.resultList}" />
    <rich:dataTable id="pendingRequestDetails" var="calls"
    value="#{pendingRequestDetails.resultList}"
    rendered="#{not empty pendingRequestDetails.resultList}"
    rows="6"
    rowClasses="#{tableLnF.getRowSettings(skinBean.skin)}"
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}"
    columnClasses="formFont2">
    <f:facet name="header">
    <rich:columnGroup>
    <rich:column
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}">
    <h:outputText value="Request No." />
    </rich:column>
    <rich:column
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}">
    <h:outputText value="Customer Name" />
    </rich:column>
    <rich:column
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}">
    <h:outputText value="Contact Number" />
    </rich:column>
    <rich:column
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}">
    <h:outputText value="Request On" />
    </rich:column>
    <rich:column
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}">
    <h:outputText value="Request Description" />
    </rich:column>
    <rich:column
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}">
    <h:outputText value="Applied On" />
    </rich:column>
    <rich:column
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}">
    <h:outputText value="Next Step Pending" />
    </rich:column>
    </rich:columnGroup>
    </f:facet>

    <rich:column align="center" sortable="true"
    filterBy="#{calls.call_ID}" filterEvent="onkeyup">
    #{calls.call_ID}
    </rich:column>

    <rich:column align="center" filterBy="#{calls.customerName}"
    filterEvent="onkeyup">

    <h:outputText value="#{calls.customerName}">
    </h:outputText>
    </rich:column>
    <rich:column align="center">
    #{calls.contactNumber}
    </rich:column>

    <rich:column align="center">
    #{calls.requestNo.requestType}
    </rich:column>
    <rich:column align="center">
    <h:outputText value="#{calls.requestNo.requestDesc}"
    rendered="#{not empty calls.requestNo.requestDesc}"></h:outputText>
    <h:outputText value=" N/A "
    rendered="#{empty calls.requestNo.requestDesc}"></h:outputText>
    </rich:column>

    <rich:column>
    <h:outputText value="#{calls.createdOn}">
    <s:convertDateTime type="date" pattern="dd/MMM/yyyy" />
    </h:outputText>
    </rich:column>
    <rich:column>
    <h:outputText
    value="#{taskConditions.getNextPendingTask('', calls.call_ID)}"></h:outputText>
    </rich:column>
    </rich:dataTable>

    </h:form>









    </rich:panelBarItem>
    </rich:panelBar>
    </rich:tab>
    <rich:tab
    label="Closed Calls(#{(closedComplaintList.resultList.size)+(closedRequestList.resultList.size)})">
    <h:outputText value="No Closed Calls exists"
    rendered="#{(closedComplaintList.resultList.size+closedRequestList.resultList.size)==0}" />
    <rich:panelBar height="100%" width="100%">
    <rich:panelBarItem
    label="Closed Complaints(#{closedComplaintList.resultList.size})">

    <h:outputText
    value="No Closed Complaints exists"
    rendered="#{empty closedComplaintList.resultList}" /> <h:form
    id="closedCallForm">
    <rich:datascroller align="center" for="closedComlList"
    maxPages="2000"
    rendered="#{not empty closedComplaintList.resultList}" />
    <rich:spacer
    rendered="#{not empty closedComplaintList.resultList}" />
    <rich:dataTable id="closedComlList" var="clcalls"
    value="#{closedComplaintList.resultList}"
    rendered="#{not empty closedComplaintList.resultList}"
    rows="6"
    rowClasses="#{tableLnF.getRowSettings(skinBean.skin)}"
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}"
    columnClasses="formFont2">
    <f:facet name="header">
    <rich:columnGroup>
    <rich:column
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}">
    <h:outputText value="Complaint No." />
    </rich:column>
    <rich:column
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}">
    <h:outputText value="Customer Name" />
    </rich:column>
    <rich:column
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}">
    <h:outputText value="Contact Number" />
    </rich:column>
    <rich:column
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}">
    <h:outputText value="Complaint On" />
    </rich:column>
    <rich:column
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}">
    <h:outputText value="Complaint Description" />
    </rich:column>
    <rich:column
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}">
    <h:outputText value="Solution Description" />
    </rich:column>
    <rich:column
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}">
    <h:outputText value="Attended By" />
    </rich:column>

    </rich:columnGroup>
    </f:facet>

    <rich:column align="center" filterBy="#{clcalls.call_ID}"
    filterEvent="onkeyup">
    #{clcalls.call_ID}
    </rich:column>

    <rich:column align="center" filterBy="#{clcalls.customerName}"
    filterEvent="onkeyup">

    <h:outputText value="#{clcalls.customerName}">
    </h:outputText>
    </rich:column>
    <rich:column align="center">
    #{clcalls.contactNumber}
    </rich:column>

    <rich:column align="center">
    #{clcalls.complaintNo.complaintType}
    </rich:column>
    <rich:column align="center">
    <h:outputText value="#{clcalls.complaintNo.complaintDesc}"
    rendered="#{clcalls.complaintNo.complaintDesc ne null}"></h:outputText>
    <h:outputText value=" N/A "
    rendered="#{clcalls.complaintNo.complaintDesc eq null}"></h:outputText>

    </rich:column>
    <rich:column align="center">
    #{clcalls.complaintNo.solutionDesc}
    </rich:column>

    <rich:column align="center">
    <h:outputText value="#{clcalls.complaintNo.attendedBy}"></h:outputText>
    </rich:column>

    </rich:dataTable>

    </h:form>
    </rich:panelBarItem>

    <rich:panelBarItem
    label="Closed Requests(#{closedRequestList.resultList.size})">

    <h:outputText
    value="No Closed Requests exists"
    rendered="#{empty closedRequestList.resultList}" /> <h:form
    id="closedReqForm">
    <rich:datascroller align="center" for="closedReqList"
    maxPages="2000"
    rendered="#{not empty closedRequestList.resultList}" />
    <rich:spacer
    rendered="#{not empty closedRequestList.resultList}" />
    <rich:dataTable id="closedReqList" var="clcalls"
    value="#{closedRequestList.resultList}"
    rendered="#{not empty closedRequestList.resultList}" rows="6"
    rowClasses="#{tableLnF.getRowSettings(skinBean.skin)}"
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}"
    columnClasses="formFont2">
    <f:facet name="header">
    <rich:columnGroup>
    <rich:column
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}">
    <h:outputText value="Request No." />
    </rich:column>
    <rich:column
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}">
    <h:outputText value="Customer Name" />
    </rich:column>
    <!--
    <rich:column
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}">
    <h:outputText value="Customer Id" />
    </rich:column>
    -->
    <rich:column
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}">
    <h:outputText value="Contact Number" />
    </rich:column>
    <rich:column
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}">
    <h:outputText value="Request On" />
    </rich:column>
    <rich:column
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}">
    <h:outputText value="Request Description" />
    </rich:column>

    <rich:column
    headerClass="#{tableLnF.getHeaderSettings(skinBean.skin)}">
    <h:outputText value="Attended By" />
    </rich:column>

    </rich:columnGroup>
    </f:facet>

    <rich:column align="center" filterBy="#{clcalls.call_ID}"
    filterEvent="onkeyup">
    #{clcalls.call_ID}
    </rich:column>

    <rich:column align="center" filterBy="#{clcalls.customerName}"
    filterEvent="onkeyup">
    <h:outputText value="#{clcalls.customerName}">
    </h:outputText>
    </rich:column>

    <rich:column align="center">
    #{clcalls.contactNumber}
    </rich:column>

    <rich:column align="center">
    #{clcalls.requestNo.requestType}
    </rich:column>
    <rich:column align="center" width="175px">
    <h:outputText value="#{clcalls.requestNo.requestDesc}"
    rendered="#{clcalls.requestNo.requestDesc ne null}"></h:outputText>
    <h:outputText value=" N/A "
    rendered="#{clcalls.requestNo.requestDesc eq null}"></h:outputText>
    </rich:column>


    <rich:column align="center">
    #{clcalls.requestNo.attendedBy}
    </rich:column>

    </rich:dataTable>

    </h:form>
    </rich:panelBarItem>
    </rich:panelBar>

    </rich:tab>
    </rich:tabPanel>
    <s:button id="done"
    rendered="#{identity.loggedIn and s:hasRole('Create Call')}"
    value="Create New Call" view="/ccr/newCall.xhtml"
    styleClass="defaultButton"
    style="#{formLnF.getButtonSettings(skinBean.skin)}" />
    </rich:panel>
    </a4j:form>

    </ui:define>
    </ui:composition>

  • 3. Re: Problem with Filters with datatable in Rich Faces
    Nick Belaevski Master

    Hello,

    You have nested forms. That's not allowed. Please remove them and check.

  • 4. Re: Problem with Filters with datatable in Rich Faces
    gopi b Newbie

    Thank u

    I removed nested forms, It's working fine.