Hi,

you're pushing your comments into the ListView.
Obviously changing the "commentsList" variable afterwards has no effect on what the ListView is iterating over.

To keep the comments up-to-date, use a model:

        ListView eachComment=new ListView("eachComment", new PropertyModel(this, 
"commentsList")){

HTH

Sven

On 08/27/2010 11:20 PM, zoran wrote:
Hi,

I have a list of products containing a link that should show a user comments
on each product in a modal window. I created a ModalWindow containing a
Panel. I send a list containing comments to this panel. I'm using a ListView
to show this comments e.g:

        ListView eachComment=new ListView("eachComment", commentsList){
                                
                        @Override
                        protected void populateItem(ListItem item) {
                                Comment comment=(Comment) item.getModelObject();
                                item.add(new 
Label("commentContent",comment.getContent()));
                        }
                };

First time I select some product, the list is created in appropriate way.
However, when I close that ModalWindow and open another one for different
product, the first list is shown again. CommentsList containing the comments
is updated before populateItem is called, but it seems that I should make
something more. Do you have any suggestions?

Zoran


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to