About the first question: http://www.jarvana.com/jarvana/view/org/apache/wicket/wicket/1.4.0/wicket-1.4.0-javadoc.jar!/org/apache/wicket/markup/html/form/AbstractSingleSelectChoice.html#setNullValid%28boolean%29
On Mon, Mar 22, 2010 at 7:06 AM, Ivan Dudko <[email protected]> wrote: > Hello guys! > > I am trying to use DropDownChoice. The first problem is no null value in > DropDownChoice... (I must add null value to choices array????) How i can do > this in right way? > > And second problem is i can't understand why if i add System.out.println in > getIdValue method it calls twice for each ID? > > This is my code: > > final ArrayList<Object> typeList = typeDAO.getData(); > DropDownChoice<Object> > ddcType = new DropDownChoice<Object>("typeid", typeList, new > IChoiceRenderer<Object>() { > > private static final long serialVersionUID = 1L; public Object > getDisplayValue(Object object) { Map<?,?> map = (Map<?,?>) object; return > map.get("Name"); } public String getIdValue(Object object, int index) { if > (object instanceof HashMap<?,?>) { > //System.out.println("Test="+map.get("ID").toString()); Map<?,?> map = > (Map<?,?>) object; return map.get("ID").toString(); } return > object.toString(); } }); form.add(ddcType.setType(Integer.class)); > > Thank you. > > Best regards, Ivan *Dudko* > -- Pedro Henrique Oliveira dos Santos
