If you use the below constrcutor, it should solve your problem. DropDownChoice(java.lang.String id, IModel model, IModel choices, IChoiceRenderer renderer)
2009/10/9 Altuğ B. Altıntaş <alt...@gmail.com>: > Hi; > I have a problem with DropDownChoice; The code block is here : > > List<Faaliyet>faaliyetListesi = // data comes > > final DropDownChoice<Faaliyet> faaliyetler = > new DropDownChoice<Faaliyet>("Faaliyetler", > new Model((Serializable) faaliyetListesi), > faaliyetlerRenderer) { > > �...@override > protected boolean wantOnSelectionChangedNotifications() > { > return true; > } > > �...@override > protected void onSelectionChanged(Faaliyet newSelection) > { > super.onSelectionChanged(newSelection); > PageParameters params = new PageParameters(); > params.add("ay", finalAy + ""); > params.add("yil", finalYil + ""); > params.add("faaliyetId", newSelection.getId() + ""); > setResponsePage(ActionPage.class, params); > > } > }; > > > add(faaliyetler); > > > > The error message is : > > wicketMessage: Method onSelectionChanged of interface > org.apache.wicket.markup.html.form.IOnChangeListener targeted at > component [MarkupContainer [Component id = Faaliyetler]] threw an > exception > > Root cause: > > java.lang.IllegalStateException: Attempt to set model object on null > model of component: Faaliyetler > at org.apache.wicket.Component.setDefaultModelObject(Component.java:3038) > at > org.apache.wicket.markup.html.form.FormComponent.updateModel(FormComponent.java:1168) > at > org.apache.wicket.markup.html.form.DropDownChoice.onSelectionChanged(DropDownChoice.java:158) > at java.lang.reflect.Method.invoke(Method.java:597) > at > org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:182) > at > org.apache.wicket.request.target.component.listener.ListenerInterfaceRequestTarget.processEvents(ListenerInterfaceRequestTarget.java:73) > at > org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.j > > -- > > Any suggestions ? > > Altuğ. > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org