Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-91

Pagination in Scaffolding can only go two pages deep

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 1.0.0.Beta1
    • Fix Version/s: 1.0.0.Beta2
    • Component/s: Scaffold
    • Labels:
      None

      Description

      http://seamframework.org/162255.lace

      this pagination code of https://github.com/forge/core/blob/master/scaffold-metawidget/src/main/resources/org/metawidget/scaffold/BackingBean.jv,

      pagination = new PaginationHelper<xyz.class>(10)

      will get executed every time next button is pressed (as the backing bean is requestscope) hence will not be able to navigate to 3 rd page, this should be bug in my opinion. I have given short term work around for this, let see what experts have to say.

      public PaginationHelper<@{entity.getName()}> getPagination(){
      	if (pagination == null){
      		pagination = new PaginationHelper<@{entity.getName()}>(10){
      			@Override
      			public int getItemsCount() {
      				return count(@{entity.getName()}.class);
      			}
      			@Override
      			public List<@{entity.getName()}> createPageDataModel(){
      				return new ArrayList<@{entity.getName()}>(findAll(@{entity.getName()}.class,
      						 getPageFirstItem(), getPageSize() ));
      			}
      		};
      	}
      	return pagination;
      }

        Gliffy Diagrams

          Activity

          Hide
          includeeasy Liu Jianhong added a comment -

          BackingBean.jv should annotated by "@SessionScoped"

          DatasourceProducer annotated by "@ConversationScoped" also have some bugs so I use transaction-type="RESOURCE_LOCAL"

          Show
          includeeasy Liu Jianhong added a comment - BackingBean.jv should annotated by "@SessionScoped" DatasourceProducer annotated by "@ConversationScoped" also have some bugs so I use transaction-type="RESOURCE_LOCAL"

            People

            • Assignee:
              lincolnthree Lincoln Baxter III
              Reporter:
              lincolnthree Lincoln Baxter III
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development