ICEfaces
  1. ICEfaces
  2. ICE-8031

ace:dataTable lazy attribute not applying update to page

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 3.0.1
    • Fix Version/s: 3.1.0.BETA2, 3.1
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      Tomcat 7.0.25
    • Assignee Priority:
      P3

      Description

      In the training materials, I swapped out the existing method of lazy loading with an ice:dataTable to one with the new ace:dataTable "lazy" attribute.

      I successfully extended the LazyDataModel and implemented the load() method. The method was called and the appropriate rows retrieved, however, I don't see them being applied to the UI.

      The source code is in repo\services\icefaces2-training\trunk\exercises\solutions\9.2.2-exercise-ace-datatable.

      Execute the build.bat file in repo\services\icefaces2-training\trunk\exercises\solutions to create the solutions source code. Then, use the source from 9.2.1 to create an Eclipse project. After that project is created add in the new 9.2.2 source code (9.2.2 is not a part of the build yet because it is not completed).

        Activity

        Hide
        Nils Lundquist added a comment -

        Please post an archive of the successful LazyDataModel implementation here.

        The instructions above do not build a working project, even after many manual adjustments.

        Show
        Nils Lundquist added a comment - Please post an archive of the successful LazyDataModel implementation here. The instructions above do not build a working project, even after many manual adjustments.
        Hide
        Nils Lundquist added a comment -

        This problem is due to the OnePageDataModel not following the contract demonstrated at: http://icefaces-showcase.icesoft.org/showcase.jsf?grp=aceMenu&exp=dataTableBean (Lazy Loading example).

        The LazyDataModel in showcase initializes its max row count via LazyDataModel.setRowCount(). This is because a LazyDataModel must know how many potential records it can load to determine the number of pages available.

        I've modified OnePageDataModel to run a query at initialization to determine how many rows are available in the total set.

        public class OnePageDataModel extends LazyDataModel<TransferApplicant> {
        public OnePageDataModel()

        { JobApplicantService jobApplicantService = (JobApplicantService)FacesUtils.getManagedBean("jobApplicantServiceImpl"); setRowCount(jobApplicantService.findAll().size()); }

        ...
        }

        It's also worth noting that the common build file that this exercise references doesn't put the persistence.xml into the right location in the WAR, and doesn't reference the required javax.persistence and eclipse link compile-time dependencies or the required run time derby dependency.

        Show
        Nils Lundquist added a comment - This problem is due to the OnePageDataModel not following the contract demonstrated at: http://icefaces-showcase.icesoft.org/showcase.jsf?grp=aceMenu&exp=dataTableBean (Lazy Loading example). The LazyDataModel in showcase initializes its max row count via LazyDataModel.setRowCount(). This is because a LazyDataModel must know how many potential records it can load to determine the number of pages available. I've modified OnePageDataModel to run a query at initialization to determine how many rows are available in the total set. public class OnePageDataModel extends LazyDataModel<TransferApplicant> { public OnePageDataModel() { JobApplicantService jobApplicantService = (JobApplicantService)FacesUtils.getManagedBean("jobApplicantServiceImpl"); setRowCount(jobApplicantService.findAll().size()); } ... } It's also worth noting that the common build file that this exercise references doesn't put the persistence.xml into the right location in the WAR, and doesn't reference the required javax.persistence and eclipse link compile-time dependencies or the required run time derby dependency.
        Hide
        Nils Lundquist added a comment -

        Should also be noted that for the pageSize cannot be final since it is configurable by the client for ace tables.

        Show
        Nils Lundquist added a comment - Should also be noted that for the pageSize cannot be final since it is configurable by the client for ace tables.

          People

          • Assignee:
            Nils Lundquist
            Reporter:
            Brad Kroeger
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: