/** * Creates a {@link Select} element with the specified {@link Select#name(String)} attribute and child nodes. * * @param name The {@link Select#name(String)} attribute. * @param children The child nodes. * @return The new element. */ public static final Select select(String name, Object...children) { return select().name(name).children(children); }
/** * Creates a {@link Select} element with the specified {@link Select#name(String)} attribute and child nodes. * * @param name The {@link Select#name(String)} attribute. * @param children The child nodes. * @return The new element. */ public static final Select select(String name, Object...children) { return select().name(name).children(children); }
/** * Creates a {@link Select} element with the specified {@link Select#name(String)} attribute and child nodes. * * @param name The {@link Select#name(String)} attribute. * @param children The child nodes. * @return The new element. */ public static final Select select(String name, Object...children) { return select().name(name).children(children); }
private Div examplesDiv(ObjectMap m) { if (m.isEmpty()) return null; Select select = null; if (m.size() > 1) { select = (Select)select().onchange("selectExample(this)")._class("example-select"); } Div div = div(select)._class("examples"); if (select != null) select.child(option("model","model")); div.child(div(m.remove("model"))._class("model active").attr("data-name", "model")); for (Map.Entry<String,Object> e : m.entrySet()) { if (select != null) select.child(option(e.getKey(), e.getKey())); div.child(div(e.getValue().toString().replaceAll("\\n", "\n"))._class("example").attr("data-name", e.getKey())); } return div; }
private Div examplesDiv(ObjectMap m) { if (m.isEmpty()) return null; Select select = null; if (m.size() > 1) { select = (Select)select().onchange("selectExample(this)")._class("example-select"); } Div div = div(select)._class("examples"); if (select != null) select.child(option("model","model")); div.child(div(m.remove("model"))._class("model active").attr("data-name", "model")); for (Map.Entry<String,Object> e : m.entrySet()) { if (select != null) select.child(option(e.getKey(), e.getKey())); div.child(div(e.getValue().toString().replaceAll("\\n", "\n"))._class("example").attr("data-name", e.getKey())); } return div; }
private Div examplesDiv(ObjectMap m) { if (m.isEmpty()) return null; Select select = null; if (m.size() > 1) { select = (Select)select().onchange("selectExample(this)")._class("example-select"); } Div div = div(select)._class("examples"); if (select != null) select.child(option("model","model")); div.child(div(m.remove("model"))._class("model active").attr("data-name", "model")); for (Map.Entry<String,Object> e : m.entrySet()) { if (select != null) select.child(option(e.getKey(), e.getKey())); div.child(div(e.getValue().toString().replaceAll("\\n", "\n"))._class("example").attr("data-name", e.getKey())); } return div; }
@Override /* Widget */ public Object getContent(RestRequest req) throws Exception { return div( form().id("form").action("servlet:/store/order").method(POST).children( table( tr( th("Pet:"), td( select().id("addPet_names").name("petId") ), td(new Tooltip("❓", "The pet to purchase.")) ), tr( th("Ship date:"), td(input().name("shipDate").type("date")), td(new Tooltip("❓", "The requested ship date.")) ), tr( td().colspan(2).style("text-align:right").children( button("reset", "Reset"), button("submit", "Submit") ) ) ).style("white-space:nowrap") ) ); } }
@Override /* Widget */ public Object getContent(RestRequest req) throws Exception { return div( form().id("form").action("servlet:/store/order").method(POST).children( table( tr( th("Pet:"), td( select().id("addPet_names").name("petId") ), td(new Tooltip("❓", "The pet to purchase.")) ), tr( th("Ship date:"), td(input().name("shipDate").type("date")), td(new Tooltip("❓", "The requested ship date.")) ), tr( td().colspan(2).style("text-align:right").children( button("reset", "Reset"), button("submit", "Submit") ) ) ).style("white-space:nowrap") ) ); } }
th("Species:"), td( select().name("species").children( option("cat"), option("dog"), option("bird"), option("fish"), option("mouse"), option("rabbit"), option("snake") ).choose(pet.getSpecies()) th("Status:"), td( select().name("status").children( option("AVAILABLE"), option("PENDING"), option("SOLD") ).choose(pet.getStatus())
th("Species:"), td( select().name("species").children( option("cat"), option("dog"), option("bird"), option("fish"), option("mouse"), option("rabbit"), option("snake") ).choose(pet.getSpecies()) th("Status:"), td( select().name("status").children( option("AVAILABLE"), option("PENDING"), option("SOLD") ).choose(pet.getStatus())
th("Species:"), td( select().name("species").children( option("CAT"), option("DOG"), option("BIRD"), option("FISH"), option("MOUSE"), option("RABBIT"), option("SNAKE")
th("Species:"), td( select().name("species").children( option("CAT"), option("DOG"), option("BIRD"), option("FISH"), option("MOUSE"), option("RABBIT"), option("SNAKE")
"Select/Optgroup/Option", Select.class, select("foo", optgroup(option("o1","v1")).label("bar")),