Package javango.forms.widgets

Examples of javango.forms.widgets.SelectMultipleWidget


 
  public void testBaseHtml() {
    Map<Object, Object> choices = new LinkedHashMap<Object, Object>();
    choices.put("1", "One");
    choices.put("2", "Two");
    javango.forms.widgets.Widget w = new SelectMultipleWidget().setChoices(choices);
    // ChoiceField field = new SelectField(injector.getInstance(WidgetFactory.class)).setChoices(choices);
    // w.setField(field);
    String[] values = {"2"};
    String output = w.render("field", values, new HashMap<String, Object>());
    String html = "<select multiple=\"multiple\" name=\"field\"><option value=\"1\" >One</option><option value=\"2\" selected=\"selected\">Two</option></select>";
View Full Code Here


   
    Map<Object, Object> choices = new LinkedHashMap<Object, Object>();
    choices.put("1", "One");
    choices.put("2", "Two");
    choices.put("3", "Three");
    javango.forms.widgets.Widget w = new SelectMultipleWidget().setChoices(choices);
//    ChoiceField field = new SelectField(injector.getInstance(WidgetFactory.class)).setChoices(choices);
//    w.setField(field);
    String[] values = {"2","3"};
    String output = w.render("field", values, new HashMap<String, Object>());
    String html = "<select multiple=\"multiple\" name=\"field\"><option value=\"1\" >One</option><option value=\"2\" selected=\"selected\">Two</option><option value=\"3\" selected=\"selected\">Three</option></select>";
View Full Code Here

TOP

Related Classes of javango.forms.widgets.SelectMultipleWidget

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.