Examples of SelectField


Examples of javango.forms.fields.SelectField

    }
   
  }
 
  public void testDefaultWidget() throws Exception {
    Field f = new SelectField(injector.getInstance(WidgetFactory.class));
    assertEquals(SelectWidget.class, f.getWidget().getClass());
  }
View Full Code Here

Examples of javango.forms.fields.SelectField

    }
   
  }
 
  public void testDefaultWidget() throws Exception {
    Field f = new SelectField(injector.getInstance(WidgetFactory.class));
    assertEquals(SelectWidget.class, f.getWidget().getClass());
  }
View Full Code Here

Examples of javango.forms.fields.SelectField

 
  public void testRequired() throws Exception {
    Map<String, String> choices = new HashMap<String, String>();
    choices.put("1", "1");
    choices.put("2", "2");
    Field<String> f = new SelectField(injector.getInstance(WidgetFactory.class)).setChoices(choices).setName("choice_field");
   
    Map<String, String> errors = new HashMap<String, String>();
   
    f.clean(new String[]{""}, errors);
    assertEquals("This field is required.", errors.get("choice_field"));
View Full Code Here

Examples of javango.forms.fields.SelectField

 
  public void testNotRequired() throws Exception {
    Map<String, String> choices = new HashMap<String, String>();
    choices.put("1", "1");
    choices.put("2", "2");
    Field<String> f = new SelectField(injector.getInstance(WidgetFactory.class)).setChoices(choices).setName("choice_field").setRequired(false);
   
    Map<String, String> errors = new HashMap<String, String>();
   
    assertEquals(null, f.clean(new String[]{""}, errors));
    assertTrue(errors.isEmpty());
View Full Code Here

Examples of javango.forms.fields.SelectField

 
  public void testAllowNull() throws Exception {
    Map<String, String> choices = new HashMap<String, String>();
    choices.put("1", "1");
    choices.put("2", "2");
    Field<String> f = new SelectField(injector.getInstance(WidgetFactory.class)).setChoices(choices).setName("choice_field").setRequired(false).setAllowNull(true);
   
    Map<String, String> errors = new HashMap<String, String>();
   
    assertEquals(null, f.clean(new String[]{""}, errors));
    assertTrue(errors.isEmpty());
View Full Code Here

Examples of javango.forms.fields.SelectField

 
  public void testGetByValue() throws Exception {
    Map<String, String> choices = new HashMap<String, String>();
    choices.put("J", "John");
    choices.put("P", "Paul");
    Field<String> f = new SelectField(injector.getInstance(WidgetFactory.class)).setChoices(choices).setName("choice_field");
   
    Map<String, String> errors = new HashMap<String, String>();
   
    assertEquals("J", f.clean(new String[]{"J"}, errors));
    assertTrue(errors.isEmpty());
View Full Code Here

Examples of javango.forms.fields.SelectField

    Map<String, String> choices = new LinkedHashMap<String, String>();
    choices.put("1", "One");
    choices.put("2", "Two");
    SelectWidget w = new SelectWidget();
    ChoiceField field = (ChoiceField) new SelectField(injector.getInstance(WidgetFactory.class)).setChoices(choices).setAllowNull(false).setName("pickme");
//    w.setField(field);
   
    String[] o = w.valueFromMap(postData, "pickme");
    assertEquals("2", o[0]);
   
View Full Code Here

Examples of javango.forms.fields.SelectField

    public FrameworkForm(FieldFactory fieldFactory, WidgetFactory widgetFactory) {
      super(fieldFactory);
      Map<String, String> choices = new LinkedHashMap<String, String>();
      choices.put("P", "Python");
      choices.put("J", "Java");
      language = new SelectField(widgetFactory).setChoices(choices).setWidget(new RadioWidget());
      init();
    }
View Full Code Here

Examples of jfix.zk.Selectfield

      appendControls();
    }
  }

  private Selectfield newTypeSelect() {
    Selectfield select = new Selectfield(Properties.getAvailableTypes());
    select.setItemRenderer(new ItemRenderer() {
      public String render(Object value) {
        return value != null ? ((Property) value).getType() : null;
      }
    });
    select.setHflex("3");
    return select;
  }
View Full Code Here

Examples of nextapp.echo2.app.SelectField

                }
            });
        }
        componentSamplerColumn.add(listBox);

        SelectField selectField = new SelectField(ListBoxTest.NUMBERS);
        if (launchModals) {
            selectField.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    getApplicationInstance().getDefaultWindow().getContent().add(createComponentSamplerModalTestWindow());
                }
            });
        }
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.