Skip to content

Instantly share code, notes, and snippets.

@marti1125
Created March 8, 2013 21:05
Show Gist options
  • Select an option

  • Save marti1125/5119841 to your computer and use it in GitHub Desktop.

Select an option

Save marti1125/5119841 to your computer and use it in GitHub Desktop.
method list
public static void list(int page, String code, String orderBy, String order) {
ObjectType type = ObjectType.get(getControllerClass());
notFoundIfNull(type);
if (page < 1) {
page = 1;
}
List<Model> objects;
Long count;
Long totalCount;
} if (StringUtils.isNotEmpty(code)) {
objects = User.find("code", code).fetch(page, getPageSize());
count = User.count("code", code);
totalCount = Usuario.count();
} else {
objects = type.findPage(page, "", "", orderBy, order, (String) request.args.get("where"));
count = type.count("", "", (String) request.args.get("where"));
totalCount = type.count(null, null, (String) request.args.get("where"));
}
render("Users/list.html", type, objects, count, totalCount, page, orderBy, order, code);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment