/** * Creates an {@link Form} element with the specified {@link Form#action(String)} attribute and child nodes. * * @param action The {@link Form#action(String)} attribute. * @param children The child nodes. * @return The new element. */ public static final Form form(String action, Object...children) { return form().action(action).children(children); }
/** * Creates an {@link Form} element with the specified {@link Form#action(String)} attribute and child nodes. * * @param action The {@link Form#action(String)} attribute. * @param children The child nodes. * @return The new element. */ public static final Form form(String action, Object...children) { return form().action(action).children(children); }
/** * Creates an {@link Form} element with the specified {@link Form#action(String)} attribute and child nodes. * * @param action The {@link Form#action(String)} attribute. * @param children The child nodes. * @return The new element. */ public static final Form form(String action, Object...children) { return form().action(action).children(children); }
return div(form().id("form").action("request:/").method(POST).children(t));
return div(form().id("form").action("request:/").method(POST).children(t));
return div(form().id("form").action("request:/").method(POST).children(t));
@RestMethod( summary="Initialize database form entry page" ) public Div getInit() { return div( form("servlet:/init").method(POST).target("buf").children( table( tr( th("Initialize petstore database:"), td(input("radio").name("init-method").value("direct").checked(true), "direct", input("radio").name("init-method").value("rest"), "rest"), td(button("submit", "Submit").style("float:right").onclick("scrolling=true")) ) ) ), br(), iframe().id("buf").name("buf").style("width:800px;height:600px;").onload("window.parent.scrolling=false;"), script("text/javascript", "var scrolling = false;", "function scroll() { if (scrolling) { document.getElementById('buf').contentWindow.scrollBy(0,50); } setTimeout('scroll()',200); } ", "scroll();" ) ); }
@RestMethod( summary="Initialize database form entry page" ) public Div getInit() { return div( form("servlet:/init").method(POST).target("buf").children( table( tr( th("Initialize petstore database:"), td(input("radio").name("init-method").value("direct").checked(true), "direct", input("radio").name("init-method").value("rest"), "rest"), td(button("submit", "Submit").style("float:right").onclick("scrolling=true")) ) ) ), br(), iframe().id("buf").name("buf").style("width:800px;height:600px;").onload("window.parent.scrolling=false;"), script("text/javascript", "var scrolling = false;", "function scroll() { if (scrolling) { document.getElementById('buf').contentWindow.scrollBy(0,50); } setTimeout('scroll()',200); } ", "scroll();" ) ); }
@RestMethod( name=GET, path="/edit", summary="Render form entry page for editing config file", description="Renders a form entry page for editing the raw text of a config file." ) public Form getConfigEditForm() { return form().id("form").action("servlet:/").method("POST").enctype("application/x-www-form-urlencoded").children( div()._class("data").children( table( tr(td().style("text-align:right").children(button("submit","Submit"),button("reset","Reset"))), tr(th().child("Contents")), tr(th().child( textarea().name("contents").rows(40).cols(120).style("white-space:pre;word-wrap:normal;overflow-x:scroll;font-family:monospace;") .text(getServletConfig().getConfig().toString())) ) ) ) ); }
@RestMethod( name=GET, path="/edit", summary="Render form entry page for editing config file", description="Renders a form entry page for editing the raw text of a config file." ) public Form getConfigEditForm() { return form().id("form").action("servlet:/").method("POST").enctype("application/x-www-form-urlencoded").children( div()._class("data").children( table( tr(td().style("text-align:right").children(button("submit","Submit"),button("reset","Reset"))), tr(th().child("Contents")), tr(th().child( textarea().name("contents").rows(40).cols(120).style("white-space:pre;word-wrap:normal;overflow-x:scroll;font-family:monospace;") .text(getServletConfig().getConfig().toString())) ) ) ) ); }
@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") ) ); } }
@Override /* Widget */ public Object getContent(RestRequest req) throws Exception { return div( form().id("form").action("servlet:/upload").method(POST).enctype("multipart/form-data").children( table( tr( th("ID:"), td(input().name("id").type("text")), td(new Tooltip("❓", "The unique identifier of the photo.", br(), "e.g. 'Fluffy'")) ), tr( th("File:"), td(input().name("file").type("file").accept("image/*")), td(new Tooltip("❓", "The image file.")) ), tr( td().colspan(2).style("text-align:right").children( button("reset", "Reset"), button("button","Cancel").onclick("window.location.href='/'"), button("submit", "Submit") ) ) ).style("white-space:nowrap") ) ); } }
@Override /* Widget */ public Object getContent(RestRequest req) throws Exception { return div( form().id("form").action("servlet:/upload").method(POST).enctype("multipart/form-data").children( table( tr( th("ID:"), td(input().name("id").type("text")), td(new Tooltip("❓", "The unique identifier of the photo.", br(), "e.g. 'Fluffy'")) ), tr( th("File:"), td(input().name("file").type("file").accept("image/*")), td(new Tooltip("❓", "The image file.")) ), tr( td().colspan(2).style("text-align:right").children( button("reset", "Reset"), button("button","Cancel").onclick("window.location.href='/'"), button("submit", "Submit") ) ) ).style("white-space:nowrap") ) ); } }
"}" ), form("servlet:/").method(POST).target("buf").children( table( tr(
"}" ), form("servlet:/").method(POST).target("buf").children( table( tr(
form().id("form").action("servlet:/pet").method(POST).children( table( tr(
form().id("form").action("servlet:/pet").method(POST).children( table( tr(
form().id("form").action("servlet:/pet/" + petId).method(POST).children( table( tr(
form().id("form").action("servlet:/pet/" + petId).method(POST).children( table( tr(