Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9035675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T08:48:46+00:00 2026-06-16T08:48:46+00:00

I am using Hibernate 4, Spring 3 and JSF 2.0 with Weblogic 10.3.6 as

  • 0

I am using Hibernate 4, Spring 3 and JSF 2.0 with Weblogic 10.3.6 as server.

I have two datatables in one page, in order to populate datatable I am using lazy loading.

The problem I am facing is when both the datatables are displayed, then pagination doesn’t work. It does goes to page 2 and 3 and so forth, but records in datatable remains the same for both datatable. If I remove either one of them then pagination works perfectly.

I have noticed that even filter is not working when I have multiple datatables. Both datatables are in a single form, they both do have two different ManagedBeans and both are of view scope. I have tried with request scope, but didn’t solve my problem.

How can I resolve this issue?

JSF Code

<h:form id="form">
    <!-- Master form -->
        <p:dataTable id="dataTable" var="req" lazy="true" value="#{emp.lazyModel}"
            paginator="true" rows="10" 
                         selection="#{emp.selectedRequest}"
                        selectionMode="single">                             
      <p:ajax event="rowSelect" listener="#{emp.onRowSelect}" />            
            <p:column id="empNo" filterBy="#{req.empNo}"   
                headerText="Request No" footerText="contains"  
                filterMatchMode="endsWith">                 
                <h:outputText value="#{req.empNo}" />
            </p:column>         
            other columns
                    </p:dataTable>              
        <!-- Detail form -->
        <p:dataTable id="dataTableDet" var="reqAct" lazy="true" value="#{dept.lazyModel}"
            paginator="true" rows="1"
            rowsPerPageTemplate="5,10">
            <f:facet name="header">                  
            Emp Details  
        </f:facet>
       <p:column>
                <f:facet name="header">
                    <h:outputText value="SLNo" />
                </f:facet>
                <h:outputText value="#{reqAct.slNo}" />
            </p:column>        
            <p:column id="empNo" filterBy="#{reqAct.empNo}"   
                headerText="Request No" footerText="contains"  
                filterMatchMode="endsWith">                 
                <h:outputText value="#{reqAct.empNo}" />
            </p:column>
        other columns
        </p:dataTable>      
        </h:form> 

Managedbean First Datatable

@Named("emp")
@Scope("view")
@PostConstruct
    public LazyDataModel<Employee> getLazyModel() {
        if (lazyModel == null) {
            lazyModel = new LazyRequestDataModel(empList, empService) {

            };          
        }

        return lazyModel;
    }

Managedbean Second Datatable

@Named("dept")
@Scope("view")
@PostConstruct
    public LazyDataModel<Department> getLazyModel() {
        if (lazyModel == null) {
            lazyModel = new LazyRequestActivitiesDataModel(deptList,
                    deptService) {

            };
        }

        return lazyModel;
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T08:48:47+00:00Added an answer on June 16, 2026 at 8:48 am

    Not sure it will help , but anyway it a better approach

    Change your @PostConstruct into public void , like this (do it for both Beans)

    @PostConstruct
    public void init(){
        initTable();
    }
    
    private void initTable(){
        lazyModel = new LazyRequestActivitiesDataModel(deptList,deptService);
    }
    
    public LazyDataModel<Department> getLazyModel() {
        return lazyModel;
    

    }

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I creating a web application using JSF,Hibernate,Spring. I have added a filter for checking
Implementing a simple Login screen using JSF and Spring and Hibernate. I have written
i'm using jsf 2.1, prettyfaces 3.3.3 and hibernate jpa 3.6.7. i have country page
I am using Hibernate 4, Spring 3 and JSF 2.0 with Weblogic 10.3.6 as
I have JSF 2.1 application uisng Spring and Hibernate. In order to solve LazyLoading
I am using Hibernate 3 and Spring 3. I have been trying to populate
I am using Hibernate 4, Spring 3 and JSF 2.0 and Weblogic 10.3.6 I
I am developing a Java Web Application using JSF, Spring and Hibernate. I need
i am using spring 3 , JSF 2 , MYSQL , Hibernate , and
I'm doing a Web application using Spring 3.1.0.RELEASE, JSF 2.x, JPA 2 with Hibernate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.