Re: ListView broken?

2008-10-23 Thread James Carman
How about just use PropertyListView? On Thu, Oct 23, 2008 at 9:39 AM, pieter claassen <[EMAIL PROTECTED]> wrote: > Guys, thanks for all your feedback. You were right. > > Cheers, > Pieter > > On Oct 23, 2008, at 2:44 PM, Jeremy Thomerson wrote: > >> Johan nailed it... here are your bad lines: >> >

Re: ListView broken?

2008-10-23 Thread pieter claassen
Guys, thanks for all your feedback. You were right. Cheers, Pieter On Oct 23, 2008, at 2:44 PM, Jeremy Thomerson wrote: Johan nailed it... here are your bad lines: System.out.println("+++"+ item.getModelObject().getClass().getName()); final QuestionAndAnswer qanda = (QuestionAndAnswer

Re: ListView broken?

2008-10-23 Thread Jeremy Thomerson
Johan nailed it... here are your bad lines: System.out.println("+++"+ item.getModelObject().getClass().getName()); final QuestionAndAnswer qanda = (QuestionAndAnswer) item.getModelObject(); setModel(new CompoundPropertyModel(qanda)); That should just be changed to: item.setModel(

Re: ListView broken?

2008-10-23 Thread Johan Compagner
What are you doing there? You get a model object from the listitem And then you are calling setmodel(compound) on the listview itself? Why is that then you are changing the model of the listview inside the loop that it goes over them creating listitems! On 10/23/08, pieter claassen <[EMAIL PROTECT

Re: ListView broken?

2008-10-23 Thread Serkan Camurcuoglu
uot; instead of "questions" and try again.. by the way are you sure that you've rebuilt and redeployed your application.. -- View this message in context: http://www.nabble.com/ListView-broken--tp20126952p20128604.html Sent from the Wicket - User mail

Re: ListView broken?

2008-10-23 Thread James Carman
So, what does it print when you print out the class name? On Thu, Oct 23, 2008 at 6:24 AM, pieter claassen <[EMAIL PROTECTED]> wrote: > Ok, I might be doing something thats not ok but . there are not two > ListViews on this page (there are 3 forms? Is this a problem?) > ClassCastException is t

Re: ListView broken?

2008-10-23 Thread pieter claassen
Ok, I might be doing something thats not ok but . there are not two ListViews on this page (there are 3 forms? Is this a problem?) ClassCastException is throw at System.out.println("") package com.musmato.wicket.pages.templates; import java.util.Arrays; import org.apache.wicket.mar

Re: ListView broken?

2008-10-23 Thread Martijn Dashorst
The classcastexception happens on retrieving the N-th item from the list. The class cast tries to cast the model object of the listview to a List. Apparently the argument to the listview is not a List, but somethign that returns a QuestionAndAnswer. Are you looking at the correct ListView (i.e. ar

Re: ListView broken?

2008-10-23 Thread Dipu
pass , sorry i have no clue On Thu, Oct 23, 2008 at 10:37 AM, pieter claassen <[EMAIL PROTECTED]>wrote: > Ok, I added; > > public class Debug { >public static void debug(List list) { >for (Object item : list) { >System.out.println("++DEBUG++: " + >

Re: ListView broken?

2008-10-23 Thread pieter claassen
Ok, I added; public class Debug { public static void debug(List list) { for (Object item : list) { System.out.println("++DEBUG++: " + item.getClass().toString()); } } and called debug just before I returned my ArrayList of

Re: ListView broken?

2008-10-23 Thread Dipu
can't you check what exactly is being returned by template.getQuestions() and if its a list what are the items in it On Thu, Oct 23, 2008 at 10:10 AM, pieter claassen <[EMAIL PROTECTED]>wrote: > Hi Dipu, > > I tried that but when I do the following: > >protected void populateI

Re: ListView broken?

2008-10-23 Thread pieter claassen
Hi Dipu, I tried that but when I do the following: protected void populateItem(ListItem item) { System.out.println("+++" + item.getModelObject().getClass().getName()); final QuestionAndAnswer qanda = (QuestionAndAnswer) item.getModelObject(); I find that I now get

Re: ListView broken?

2008-10-23 Thread pieter claassen
ds, Pieter pieter claassen [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/ListView-broken--tp2012695

Re: ListView broken?

2008-10-23 Thread Serkan Camurcuoglu
AIL PROTECTED] > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Li

Re: ListView broken?

2008-10-23 Thread Dipu
looks like template.getQuestions() is returning a list with items in it which is not of the type QuestionAndAnswer try iterating through the list and logging the class name of each item in it Dipu On Thu, Oct 23, 2008 at 9:46 AM, pieter claassen <[EMAIL PROTECTED]>wrote: > I am getting a cl

ListView broken?

2008-10-23 Thread pieter claassen
I am getting a classcast exception in ListView that is stumping me. This is the error message (top few lines) WicketMessage: Error attaching this container for rendering: [MarkupContainer [Component id = questioneditform]] Root cause: java.lang.ClassCastException: com.musmato.model.Question