Package javango.forms.widgets

Examples of javango.forms.widgets.Widget


    Map<Object, Object> choices = new LinkedHashMap<Object, Object>();
    choices.put("J", "John");
    choices.put("P", "Paul");
    choices.put("G", "George");
    choices.put("R", "Ringo");
    Widget w = new RadioWidget(choices);
    String out = w.render("beatle", new String[] {"J"}, null);
   
    String correct = "<ul>\n" +
        "<li><label><input name=\"beatle\" type=\"radio\" value=\"J\" checked=\"checked\" /> John</label></li>\n" +
        "<li><label><input name=\"beatle\" type=\"radio\" value=\"P\" /> Paul</label></li>\n" +
        "<li><label><input name=\"beatle\" type=\"radio\" value=\"G\" /> George</label></li>\n" +
View Full Code Here


    Map<Object, Object> choices = new LinkedHashMap<Object, Object>();
    choices.put("J", "John");
    choices.put("P", "Paul");
    choices.put("G", "George");
    choices.put("R", "Ringo");
    Widget w = new RadioWidget(choices);
    String out = w.render("beatle", new String[] {""}, null);
   
    String correct = "<ul>\n" +
        "<li><label><input name=\"beatle\" type=\"radio\" value=\"J\" /> John</label></li>\n" +
        "<li><label><input name=\"beatle\" type=\"radio\" value=\"P\" /> Paul</label></li>\n" +
        "<li><label><input name=\"beatle\" type=\"radio\" value=\"G\" /> George</label></li>\n" +
View Full Code Here

    Map<Object, Object> choices = new LinkedHashMap<Object, Object>();
    choices.put("J", "John");
    choices.put("P", "Paul");
    choices.put("G", "George");
    choices.put("R", "Ringo");
    Widget w = new RadioWidget(choices);
    String out = w.render("beatle", null, null);
   
    String correct = "<ul>\n" +
        "<li><label><input name=\"beatle\" type=\"radio\" value=\"J\" /> John</label></li>\n" +
        "<li><label><input name=\"beatle\" type=\"radio\" value=\"P\" /> Paul</label></li>\n" +
        "<li><label><input name=\"beatle\" type=\"radio\" value=\"G\" /> George</label></li>\n" +
View Full Code Here

    Map<Object, Object> choices = new LinkedHashMap<Object, Object>();
    choices.put("J", "John");
    choices.put("P", "Paul");
    choices.put("G", "George");
    choices.put("R", "Ringo");
    Widget w = new RadioHorizontalWidget(choices);
    String out = w.render("beatle", new String[] {"J"}, null);
   
    String correct = "<label><input name=\"beatle\" type=\"radio\" value=\"J\" checked=\"checked\" /> John</label>" +
        "<label><input name=\"beatle\" type=\"radio\" value=\"P\" /> Paul</label>" +
        "<label><input name=\"beatle\" type=\"radio\" value=\"G\" /> George</label>" +
        "<label><input name=\"beatle\" type=\"radio\" value=\"R\" /> Ringo</label>";
View Full Code Here

public class DateWidgetTest extends InjectedTestCaseBase {

  private Log log = LogFactory.getLog(DateWidgetTest.class);
 
  public void testBasicValue() {
    Widget w = new DateWidget();
    Date value = new Date("1/1/2010");
    String output = w.render("field", value, new LinkedHashMap<String, Object>());
    String html = "<input type=\"text\" name=\"field\" value=\"01/01/2010\" />";
    assertEquals(html, output);
  }
View Full Code Here

    String html = "<input type=\"text\" name=\"field\" value=\"01/01/2010\" />";
    assertEquals(html, output);
  }
 
  public void testRedonly() {
    Widget w = new DateWidget();
    Date value = new Date("1/1/2010");
    String output = w.asText(value);
    String html = "01/01/2010";
    assertEquals(html, output);
  }
View Full Code Here

TOP

Related Classes of javango.forms.widgets.Widget

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.