Examples of asTable()


Examples of javango.forms.Form.asTable()

        "<tr><th><label for='id_poll'>Poll</label></th><td><select id=\"id_poll\" name=\"poll\"><option value=\"\" >--</option>" +
        "<option value=\"1\" selected=\"selected\">AdminTestQuestion : 0</option>" +
        "<option value=\"2\" >AdminTestQuestion : 1</option>" +
        "</select></td></tr>\n" +
        "<tr><th><label for='id_votes'>Votes</label></th><td><input id=\"id_votes\" type=\"text\" name=\"votes\" value=\"0\" /></td></tr>\n";
    assertEquals(expected, form.asTable());
  }

  public class TestFormQuerySet extends AbstractForm {
    public ModelChoiceField<Choice> mcf = fields.newField(ModelChoiceField.class).setModel(Choice.class);
   
View Full Code Here

Examples of javango.forms.Form.asTable()

    String expected = "<tr><th>Subject</th><td><input type=\"text\" name=\"subject\" value=\"hello\" /></td></tr>\n" +
        "<tr><th>Message</th><td><input type=\"text\" name=\"message\" value=\"Hi there\" /></td></tr>\n" +
        "<tr><th>Sender</th><td><input type=\"text\" name=\"sender\" value=\"foo@example.com\" /></td></tr>\n" +
        "<tr><th>Value</th><td><input type=\"text\" name=\"value\" value=\"1234\" /></td></tr>\n" +
        "<tr><th>Cc Myself</th><td><input type=\"checkbox\" name=\"ccMyself\" checked=\"checked\" /></td></tr>\n";
    assertEquals(expected, f.asTable());

  }
  public void testValidateData() throws Exception {
    Map<String, String[]> m = new HashMap<String, String[]>();
    m.put("subject", new String[] {"hello"});
View Full Code Here

Examples of javango.forms.Form.asTable()

    String expected = "<tr><th><label for='id_prefix-subject'>Subject</label></th><td><input id=\"id_prefix-subject\" type=\"text\" name=\"prefix-subject\" value=\"hello\" /></td></tr>\n" +
        "<tr><th><label for='id_prefix-message'>Message</label></th><td><input id=\"id_prefix-message\" type=\"text\" name=\"prefix-message\" value=\"Hi there\" /></td></tr>\n" +
        "<tr><th><label for='id_prefix-sender'>Sender</label></th><td><input id=\"id_prefix-sender\" type=\"text\" name=\"prefix-sender\" value=\"foo@example.com\" /></td></tr>\n" +
        "<tr><th><label for='id_prefix-ccMyself'>Cc Myself</label></th><td><input id=\"id_prefix-ccMyself\" type=\"checkbox\" name=\"prefix-ccMyself\" checked=\"checked\" /></td></tr>\n" +
        "<tr><th><label for='id_prefix-value'>Value</label></th><td><input id=\"id_prefix-value\" type=\"text\" name=\"prefix-value\" value=\"1234\" /></td></tr>\n";
    assertEquals(expected, f.asTable());
  }
 
  public void testNoPrefixHtml() throws Exception {
    Map<String, String[]> m = new HashMap<String, String[]>();
    m.put("subject", new String[] {"hello"});
View Full Code Here

Examples of javango.forms.Form.asTable()

    String expected = "<tr><th><label for='id_subject'>Subject</label></th><td><input id=\"id_subject\" type=\"text\" name=\"subject\" value=\"hello\" /></td></tr>\n" +
        "<tr><th><label for='id_message'>Message</label></th><td><input id=\"id_message\" type=\"text\" name=\"message\" value=\"Hi there\" /></td></tr>\n" +
        "<tr><th><label for='id_sender'>Sender</label></th><td><input id=\"id_sender\" type=\"text\" name=\"sender\" value=\"foo@example.com\" /></td></tr>\n" +
        "<tr><th><label for='id_ccMyself'>Cc Myself</label></th><td><input id=\"id_ccMyself\" type=\"checkbox\" name=\"ccMyself\" checked=\"checked\" /></td></tr>\n" +
        "<tr><th><label for='id_value'>Value</label></th><td><input id=\"id_value\" type=\"text\" name=\"value\" value=\"1234\" /></td></tr>\n";
    assertEquals(expected, f.asTable());
  }

}
View Full Code Here

Examples of javango.forms.Form.asTable()

    Form f = injector.getInstance(ContactForm.class).setId(null);
    String expected = "<input type=\"text\" name=\"value\" />";   
    assertEquals(expected, f.get("value").toString());

    expected = "<tr><th>Value</th><td><input type=\"text\" name=\"value\" /></td></tr>\n";
    String html = f.asTable();
    assertEquals(expected, html);
  }
 
  public void testChanged() throws Exception {
    Map<String, String[]> m = new HashMap<String, String[]>();
View Full Code Here

Examples of javango.forms.Form.asTable()

    f.isValid();
    String expected = "<input type=\"text\" name=\"prefix-newvalue\" value=\"1234\" />";   
    assertEquals(expected, f.get("value").toString());
   
    expected = "<tr><th>Newvalue</th><td><input type=\"text\" name=\"prefix-newvalue\" value=\"1234\" /></td></tr>\n";
    String html = f.asTable();
    assertEquals(expected, html);
  }
 
  public void testFieldIteration() throws Exception {
    Form f = injector.getInstance(ContactForm.class).setPrefix("prefix").setId(null);
View Full Code Here

Examples of javango.forms.Form.asTable()

        "<tr><th><label for='id_sender'>Sender</label></th><td><input id=\"id_sender\" type=\"text\" name=\"sender\" /></td></tr>\n" +
        "<tr><th><label for='id_cost'>Cost</label></th><td><input id=\"id_cost\" type=\"text\" name=\"cost\" /></td></tr>\n" +
        "<tr><th><label for='id_ccMyself'>Carbon Copy Myself</label></th><td><input id=\"id_ccMyself\" type=\"checkbox\" name=\"ccMyself\" /></td></tr>\n" +
        "<tr><th><label for='id_value'>The Value</label></th><td><input id=\"id_value\" type=\"text\" name=\"value\" />" +
        "<input id=\"id_hiddenField\" type=\"hidden\" name=\"hiddenField\" />\n</td></tr>\n";
    assertEquals(expected, f.asTable());
  }

  public void testBasicHtml() throws Exception {
    Map<String, String[]> m = new HashMap<String, String[]>();
    m.put("subject", new String[] {"hello"});
View Full Code Here

Examples of javango.forms.Form.asTable()

        "<tr><th>Sender</th><td><input type=\"text\" name=\"sender\" value=\"foo@example.com\" /></td></tr>\n" +
        "<tr><th>Cost</th><td><input type=\"text\" name=\"cost\" value=\"1.23\" /></td></tr>\n" +
        "<tr><th>Carbon Copy Myself</th><td><input type=\"checkbox\" name=\"ccMyself\" checked=\"checked\" /></td></tr>\n" +
        "<tr><th>The Value</th><td><input type=\"text\" name=\"value\" value=\"1234\" />" +
        "<input type=\"hidden\" name=\"hiddenField\" />\n</td></tr>\n";
    assertEquals(expected, f.asTable());
  }
 
  public void testBasicError() throws Exception {
    Map<String, String[]> m = new HashMap<String, String[]>();
    m.put("hiddenField", new String[] {"hidden value"});
View Full Code Here

Examples of javango.forms.Form.asTable()

        "<tr><th>Sender</th><td><input type=\"text\" name=\"sender\" value=\"foo@example.com\" /></td></tr>\n" +
        "<tr><th>Cost</th><td><input type=\"text\" name=\"cost\" value=\"1.23\" /></td></tr>\n" +
        "<tr><th>Carbon Copy Myself</th><td><input type=\"checkbox\" name=\"ccMyself\" checked=\"checked\" /></td></tr>\n" +
        "<tr><th>The Value</th><td><input type=\"text\" name=\"value\" value=\"1234\" />" +
        "<input type=\"hidden\" name=\"hiddenField\" value=\"hidden value\" />\n</td></tr>\n";
    assertEquals(expected, f.asTable());
  }
 
  public void testReadonly() throws Exception {
    Form f = injector.getInstance(ContactForm.class);
    f.getFields().get("sender").setEditable(false);
View Full Code Here

Examples of javango.forms.Form.asTable()

        "<tr><th><label for='id_sender'>Sender</label></th><td><input id=\"id_sender\" readonly=\"readonly\" type=\"text\" name=\"sender\" /></td></tr>\n" +
        "<tr><th><label for='id_cost'>Cost</label></th><td><input id=\"id_cost\" readonly=\"readonly\" type=\"text\" name=\"cost\" /></td></tr>\n" +
        "<tr><th><label for='id_ccMyself'>Carbon Copy Myself</label></th><td><input id=\"id_ccMyself\" type=\"checkbox\" name=\"ccMyself\" /></td></tr>\n" +
        "<tr><th><label for='id_value'>The Value</label></th><td><input id=\"id_value\" type=\"text\" name=\"value\" />" +
        "<input id=\"id_hiddenField\" type=\"hidden\" name=\"hiddenField\" />\n</td></tr>\n";
    assertEquals(expected, f.asTable());
  }

  public void testMaxlength() throws Exception {
    Form f = injector.getInstance(ContactForm.class);
    ((CharField)f.getFields().get("message")).setMaxLength(20);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.