01: package simpleorm.simplewebapp.eg.database;
02:
03: import simpleorm.simplewebapp.dbute.WGenericListPagelet;
04: import simpleorm.simplewebapp.eg.dbute.WUser;
05: import simpleorm.simplewebapp.core.*;
06: import simpleorm.simplewebapp.scalarFields.WFieldString;
07: import simpleorm.simplewebapp.scalarFields.WFieldInteger;
08:
09: public abstract class WUserListPage extends WTestPage {
10:
11: public final WUserListPagelet pagelet = new WUserListPagelet(this );
12:
13: public static class WUserListPagelet extends WGenericListPagelet {
14:
15: final WFieldString nameWord = addField(searchFields,
16: new WFieldString("nameWord"));
17:
18: final WField user_id = addField(listFields, new WFieldInteger(
19: "userId"));
20: final WField name = addField(listFields, new WFieldString(
21: "name"));
22: final WField phone = addField(listFields, new WFieldString(
23: "phone"));
24:
25: public WUserListPagelet(WPage wpage) {
26: super (wpage, "list");
27: }
28:
29: protected @Override
30: void onWasSubmitted() throws Exception {
31: String nw = nameWord.getText() == null ? "" : nameWord
32: .getText();
33: queryData(WUser.meta, WUser.NAME, "%" + nw + "%", sorter
34: .getValue());
35: }
36:
37: }
38: }
|