1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.exoplatform.ecm.webui.core;
18
19 import java.util.List;
20
21 import org.exoplatform.webui.config.annotation.ComponentConfig;
22 import org.exoplatform.webui.core.UIComponent;
23 import org.exoplatform.webui.core.UIGrid;
24
25
26
27
28
29
30
31 @ComponentConfig(template = "classpath:groovy/ecm/webui/core/UIGrid.gtmpl")
32 public abstract class UIPagingGrid extends UIGrid {
33
34 protected UIECMPageIterator uiPageIterator_;
35
36 public UIPagingGrid() throws Exception
37 {
38 uiPageIterator_ = createUIComponent(UIECMPageIterator.class, null, null);
39 uiPageIterator_.setParent(this);
40 }
41
42 public abstract void refresh(int currentPage) throws Exception;
43
44 public UIECMPageIterator getUIPageIterator()
45 {
46 return uiPageIterator_;
47 }
48
49
50 public List<?> getBeans() throws Exception
51 {
52 return uiPageIterator_.getCurrentPageData();
53 }
54
55 public UIComponent findComponentById(String lookupId)
56 {
57 if (uiPageIterator_.getId().equals(lookupId))
58 {
59 return uiPageIterator_;
60 }
61 return super.findComponentById(lookupId);
62 }
63 }