Sorry for my poor english ;)

I have ListView and model like below. I need tabs to reload sometimes,
so my model is dynamic and get tabs from database.
But i see that something is wrong. When i want to get Tab object by
getModelObject() in populateItem method i suppoused that i got it
directly, but i see that all the times the getObject() method of model
is triggered making for all items new list (new db request) !

How to get Tab objects for items without making wasting time database
request ???


                IModel model = new IModel() {
                        public Object getObject() {
                                System.out.println("getObject...");
                                ...
                                // getting list from DB
                                List<Tab> list = ....;
                                return list;
                        }

                        public void setObject(Object object) {}
                        public void detach() {
                        }};
                
                ListView tabs = new ListView("tabs", model) {
                        @Override
                        protected void populateItem(ListItem item) {
                                item.getModelObject(); /* <------------- new 
list, and new list,
and new list...... :(
                        }
                };

-- 
Greetings,
marioosh

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

Reply via email to