01: package simpleorm.simplewebapp.eg.simple;
02:
03: import simpleorm.simplewebapp.core.WPage;
04: import simpleorm.simplewebapp.core.WField;
05:
06: /**
07: * Demonstration of List and Crud Pagelets on the same WPage.
08: */
09: public class WManualListCrudPage extends WPage {
10:
11: public final WCrudPage.WCrudPagelet crudPagelet = new WCrudPage.WCrudPagelet(
12: this );
13:
14: public WField getId() {
15: return crudPagelet.id;
16: }
17:
18: public final WListPage.WListPageletEg listPagelet = new WListPage.WListPageletEg(
19: this );
20:
21: protected void onInitialize() throws Exception {
22: listPagelet.setListCrudItem(getPageStructure().getPageItem()); // Not in constructor as getPageItem not defined then.
23: WTestDatabase.db.beginTransaction();
24: }
25:
26: protected void onFinalize() throws Exception {
27: WTestDatabase.db.endTransaction();
28: }
29:
30: }
|