Ritesh, There is no need for the else block in the code you have included to call setModelObject as it will only be exercised if there is a collection set already.
Double check that somewhere in your code you are not explicitly or implicitly setting the modelObject to null or setting the model to one whose getObject returns null (and, of course, that your "whatever", which must be a Collection, is not null). Regards - Cemal http://www.jWeekend.co.uk http://jWeekend.co.uk Ritesh Trivedi wrote: > > Hi, > > Is there a reason why CheckGroup.updateModel() does not call > setModelObject()? If I create Checkgroup with the following > > CheckGroup myCheckGroup = new CheckGroup("id", new Model() { public Object > getObject() { return whatever;}}); > > Later on - call to myCheckGroup.getModelObject() returns null ! > > Not sure if this is intended behavior - but its definitely strange. > > > Here is an excerpt from CheckGroup.java - else block is not setting the > model object. > > public void updateModel() > { > Collection collection = (Collection)getModelObject(); > if (collection == null) > { > collection = (Collection)getConvertedInput(); > setModelObject(collection); > } > else > { > modelChanging(); > collection.clear(); > collection.addAll((Collection)getConvertedInput()); > modelChanged(); > } > } > -- View this message in context: http://www.nabble.com/CheckGroup-updateModel%28%29-bug--tp19083157p19087780.html Sent from the Wicket - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
