public static void schemaList(Element list, List<Skeema> skeemas) { list.html(""); int i = 0; for (Skeema s : skeemas) { if (i < 11) { Element elm = list.appendElement("li") .appendElement("a") .attr("href", "/schema/" + s.getId().toString()) .text(s.skeemaID); } else if (i == 11) { Element elm = list.appendElement("li") .appendElement("a") .attr("href", "#") .addClass("moreSchemas") .text("MORE..."); } else { list.appendElement("li") .appendElement("a") .addClass("hiddenSchema hidden") .attr("href", "/schema/" + s.getId().toString()) .text(s.skeemaID); } i++; } }
public static void schemaSelect(Element select, List<Skeema> skeemas) { List<Skeema> schemas = Skeema.all().fetch(); for (Skeema s : schemas) { System.out.println(s); Element elm = select.appendElement("option").attr("value", s.getId().toString()).text(s.skeemaID); if (skeemas.contains(s)) { elm.attr("selected", "selected"); } } }