not sure if that's the problem, but shouldn't setChoices(titles);
be setChoices(departments); On Wed, Jan 20, 2010 at 4:14 PM, chinedu efoagui <chinedub...@gmail.com> wrote: > Hello , I have a class PersonnelrecordsDepartment > with the following fields with corresponding getters and setters > private java.lang.Integer id; > private java.lang.String departmentname; > private java.lang.Integer parentid; > > I left out the getters and setters . Any the field parentid can refer > to an existing department like a recursive stuff like having a self > foreign key > Anyway the problem is that i have a dropdownlchoice for the form > <code> > public class DepartmentDropDownChoice extends DropDownChoice { > > �...@springbean(name="IHRService") > private IHRService dao; > > */ /** > * > * @param id > * @param model > */ > public DepartmentDropDownChoice(String id,final IModel model){ > > super(id,model); > final ChoiceRenderer renderer = new > ChoiceRenderer("departmentname", "id"); > > setChoiceRenderer(renderer); > List<PersonnelrecordsDepartment> departments=Collections.EMPTY_LIST; > try { > departments = dao.getPersonnelrecordsDepartmentList(); > } catch (GenericBusinessException ex) { > > Logger.getLogger(DepartmentDropDownChoice.class.getName()).log(Level.SEVERE, > null, ex); > } > setChoices(titles); > } > </code> > > and it gives this error anytime i try to save the personneldepartment object > <code> > 2010-01-20 16:12:07,745 ERROR [org.apache.wicket.RequestCycle] - > <Cannot format given Object as a Number> > java.lang.IllegalArgumentException: Cannot format given Object as a Number > at java.text.DecimalFormat.format(DecimalFormat.java:487) > at java.text.Format.format(Format.java:140) > at > org.apache.wicket.util.convert.converters.AbstractNumberConverter.convertToString(AbstractNumberConverter.java:111) > at > org.apache.wicket.util.lang.PropertyResolverConverter.convert(PropertyResolverConverter.java:85) > at > org.apache.wicket.util.lang.PropertyResolver$MethodGetAndSet.setValue(PropertyResolver.java:1107) > at > org.apache.wicket.util.lang.PropertyResolver$ObjectAndGetSetter.setValue(PropertyResolver.java:588) > at > org.apache.wicket.util.lang.PropertyResolver.setValue(PropertyResolver.java:136) > at > org.apache.wicket.model.AbstractPropertyModel.setObject(AbstractPropertyModel.java:169) > at > org.apache.wicket.Component.setDefaultModelObject(Component.java:3052) > at > org.apache.wicket.markup.html.form.FormComponent.updateModel(FormComponent.java:1168) > at > org.apache.wicket.markup.html.form.Form$FormModelUpdateVisitor.component(Form.java:225) > at > org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrderHelper(FormComponent.java:514) > at > org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrderHelper(FormComponent.java:493) > at > org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrder(FormComponent.java:465) > at > org.apache.wicket.markup.html.form.Form.internalUpdateFormComponentModels(Form.java:2051) > at > org.apache.wicket.markup.html.form.Form.updateFormComponentModels(Form.java:2019) > at org.apache.wicket.markup.html.form.Form.process(Form.java:984) > at org.apache.wicket.markup.html.form.Form.process(Form.java:911) > at > org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:876) > at > org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:135) > at > org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177) > at > org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:299) > > </code> > > i think it has something to do with the conversion. but how do i > convert it again?? > How can i solve this problem??? > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org