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 9237055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:26:52+00:00 2026-06-18T07:26:52+00:00

Recently I upgraded my project from primefaces 3.3.1 to 3.4.1 . Except Lazy Data

  • 0

Recently I upgraded my project from primefaces 3.3.1 to 3.4.1 . Except Lazy Data Model all the remaining project is working fine. Do I have to make any additional changes?

my xhtml code:

 <h:panelGroup id="clsTablePanel">
            <p:dataTable var="cls" value="#{classesBean.classModel}"
                sortBy="#{cls.classId}" sortOrder="descending"
                selectionMode="single" selection="#{classesBean.selectedClass}"
                paginator="true" rows="5" paginatorAlwaysVisible="false"
                paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}"
                lazy="true" widgetVar="clsTable" style="width:auto;margin:10px;">
                <p:ajax event="rowSelect" listener="#{classesBean.classRowSelect}"
                    update=":mainTab:clsDetailPanel" />
                <f:facet name="header">
                    <h:outputText value="#{titles.classList}" />
                </f:facet>

                <p:column headerText="Class Id" sortBy="#{cls.classId}"
                    style="width:10%;">
                #{cls.classId}
            </p:column>
                <p:column headerText="Class" sortBy="#{cls.className}"
                    style="width:10%;">
                #{cls.className}
            </p:column>
                <p:column headerText="Coordinator" style="width:20%;">
                #{cls.mtmdemployees.firstName}
            </p:column>
                <p:column headerText="Location" style="width:20%;">
                #{cls.mtmdlocation.locShortName}
            </p:column>

            </p:dataTable>
        </h:panelGroup>
    </div>
    <div>
        <p:outputPanel id="clsDetailPanel">

            <h:form>
                <p:messages id="clsmsgs" style="width:98%;margin:5px auto;" />
                <p:panelGrid columns="4" style="width:98%;margin:5px auto;">
                    <f:facet name="header">
                        <h:outputText value="#{titles.classinfo}"></h:outputText>
                    </f:facet>

                    <h:outputText value="ClassId"></h:outputText>
                    <p:inputText value="#{classesBean.selectedClass.classId}"
                        disabled="true" />

                    <h:outputText value="Class Name"></h:outputText>
                    <p:inputText value="#{classesBean.selectedClass.className}"
                        required="true" requiredMessage="Enter Class Name" />

                    <h:outputText value="Coordinator"></h:outputText>
                    <p:selectOneMenu value="#{classesBean.selectedEmployeeId}"
                        style="height:20px;">
                        <f:selectItems value="#{classesBean.employeesList}" var="emp"
                            itemLabel="#{emp.firstName}" itemValue="#{emp.employeeId}" />
                    </p:selectOneMenu>


                    <h:outputText value="Location"></h:outputText>
                    <p:selectOneMenu value="#{classesBean.selectedLocationId}">
                        <f:selectItems value="#{classesBean.locationList}" var="loc"
                            itemLabel="#{loc.locShortName}" itemValue="#{loc.locationId}" />
                    </p:selectOneMenu>

                    <f:facet name="footer">
                        <p:commandButton widgetVar="updateBt" value="Update"
                            action="#{classesBean.classesUpdate}" ajax="true" process="@form"
                            update="clsmsgs :mainTab:clsTablePanel"
                            disabled="#{classesBean.updateDisable}"
                            style="margin-left:5px;margin-right:5px;" />
                        <p:commandButton widgetVar="createBt" value="Create"
                            action="#{classesBean.classesCreate}" ajax="true" process="@form"
                            update="clsmsgs :mainTab:clsTablePanel"
                            disabled="#{classesBean.createDisable}"
                            style="margin-left:5px;margin-right:5px;" />
                        <p:commandButton widgetVar="clearBt" value="Clear"
                            action="#{classesBean.classesClear}" ajax="true" process="@none"
                            update="@form" oncomplete="clsTable.unselectAllRows()"
                            style="margin-left:5px;margin-right:5px;" />
                    </f:facet>

                </p:panelGrid>
            </h:form>
        </p:outputPanel>

my Lazy Data Model code:

@Named
@WindowScoped
public class ClassLazyDataModel extends LazyDataModel<Mtmdclass> implements
        Serializable {

    static final long serialVersionUID = 12l;
    private static final Log log = LogFactory.getLog(ClassLazyDataModel.class);

    @Inject
    private HibernateUtil hibernateUtil;

    @Inject
    MtmdclassHome clsHome;

    private List<Mtmdclass> clsList = new ArrayList<Mtmdclass>();

    public ClassLazyDataModel() {
    }

    @PostConstruct
    public void init() {
        setDataModelSize();
    }

    public void setDataModelSize() {
        try {
            hibernateUtil.beginTransaction();               
            Long count = clsHome.getClassCount();
            this.setRowCount(count.intValue());
            hibernateUtil.commitTransaction();
            log.debug("Row Count:" + count);
        } catch (Exception ex) {
            if (hibernateUtil.isTransactionActive())
                hibernateUtil.rollbackTransaction();
            log.error("Exception getting employee row count" + ex);
            FacesContext.getCurrentInstance().addMessage(
                    null,
                    new FacesMessage(FacesMessage.SEVERITY_ERROR,
                            "Error getting employee row count",
                            "Error getting employee row count"));
        }
    }

    @SuppressWarnings("unchecked")
    @Override
    public Mtmdclass getRowData(String rowKey) {
        List<Mtmdclass> clsrows = (List<Mtmdclass>) getWrappedData();
        for (Mtmdclass cls : clsrows) {
            if (rowKey.equals((cls.getClassId()).toString()))
                return cls;
        }
        return null;
    }

    @Override
    public Object getRowKey(Mtmdclass cls) {
        log.debug("in getRowKey:classId" + cls.getClassId());
        return cls.getClassId();
    }

    @SuppressWarnings("unchecked")
    @Override
    public List<Mtmdclass> load(int first, int pageSize, String sortField,
            SortOrder sortOrder, Map<String, String> filters) {
        log.debug("First:" + first + " PageSige:" + pageSize + " SortField:"
                + sortField + " SortOrder:" + sortOrder);
        try {
            // MtmdclassHome clsHome = new MtmdclassHome();
            hibernateUtil.beginTransaction();
            clsList = clsHome.lazyLoad(first, pageSize, sortField, sortOrder);
            for (Mtmdclass cls : clsList) {
                Hibernate.initialize(cls.getMtmdlocation());
                Hibernate.initialize(cls.getMtmdemployees());
            }
            hibernateUtil.commitTransaction();
            log.debug("in load: class Row Count: " + clsList.size());
        } catch (Exception ex) {
            if (hibernateUtil.isTransactionActive())
                hibernateUtil.rollbackTransaction();
            log.error("Exception fetching Employee List" + ex);
            FacesContext.getCurrentInstance()
                    .addMessage(
                            null,
                            new FacesMessage(FacesMessage.SEVERITY_ERROR,
                                    "Error Getting Students",
                                    "Error Getting Students"));
        }
        return clsList;
    }
}

my bean

@Inject
    ClassLazyDataModel classLDM;
private LazyDataModel<Mtmdclass> classModel;

public void loadClassesModel() {
        classModel = classLDM;
    }

            public void classRowSelect() {
                    oldEmpId = selectedClass.getMtmdemployees().getEmployeeId();

                    if (selectedClass.getMtmdemployees() != null) {
                        setSelectedEmployeeId(selectedClass.getMtmdemployees()
                                .getEmployeeId());
                    }
                    if (selectedClass.getMtmdlocation() != null) {
                        setSelectedLocationId(selectedClass.getMtmdlocation()
                                .getLocationId());
                    }
                    updateDisable = Boolean.FALSE;
                    createDisable = Boolean.TRUE;
                }

        public Mtmdclass getSelectedClass() {
                return selectedClass;
            }

            public void setSelectedClass(Mtmdclass selectedClass) {
                this.selectedClass = selectedClass;
            }
    public LazyDataModel<Mtmdclass> getClassModel() {
            return classModel;
        }

        public void setClassModel(LazyDataModel<Mtmdclass> classModel) {
            this.classModel = classModel;
        }
  • 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-18T07:26:54+00:00Added an answer on June 18, 2026 at 7:26 am

    This is likely related to partial ajax behavior changes in 3.4. Below is the from the 3.4 migration guide

    partialSubmit is now false by default. It can be globally configured using primefaces.SUBMIT context parameter and components can override the global setting with provided partialSubmit attribute
    

    Try setting the primefaces.SUBMIT to true in web.xml and see if this is solved.

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

Sidebar

Related Questions

I have recently upgraded my MVC 3 project to MVC 4. After all the
I recently upgraded a C# project from .NET 3.5 to .NET 4. I have
We just recently upgraded from VS2008 to VS2010. Our project compiles fine; but when
my company has recently upgraded from VS2005 to VS2010. We have a huge project
I have recently upgraded an existing java project from java 1.4 to 1.6 and
I recently upgraded a rails project I am working on from 2.0.5 to 2.3.2.
We have recently upgraded all our projects from .NET 3.5 to .NET 4. I
I have recently upgraded Tridion from 2009 to 2011 SP1 and working on the
I recently upgraded one of my project from MVC2 to MVC3 and adjusted some
I've recently upgraded a project from MVC 1 to MVC 3 and now I'm

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.