im not really sure what/where/why would be asked for twice?

dataview caches the size() for the duration of the request, and iterator()
is only called once per request...

-igor


On 1/18/07, Tim Squires <[EMAIL PROTECTED]> wrote:

Thanks Igor, the DataProvider /was/ caching the results.  Do you know if
there's a nice way of retrieving the iterator and size without
retrieving the results twice?

i.e. I currently have

        public Iterator iterator(int first, int count) {
                return
ATMInstallsDao.getFromApplicationContext().getAllTasks().subList(first,
first + count)
                                .iterator();
        }

        public int size() {
                return
ATMInstallsDao.getFromApplicationContext().getAllTasks().size();
        }

Since it's using Sping/Hibernate/EhCache it does not actually go back to
the database but it would be nice not to ask the cache for the results
twice.

Thanks,
Tim

________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Igor
Vaynberg
Sent: 17 January 2007 16:07
To: wicket-user@lists.sourceforge.net
Subject: Re: [Wicket-user] DataView modelChanged


you dont need to do anything. next request the dataprovider is polled
again. if the dataview really doesnt refresh make sure your
dataprovider/orm layer are not doing any caching.

-igor



On 1/17/07, Tim Squires <[EMAIL PROTECTED]> wrote:

        Hi again,

        I have a simple DataView where one of the columns contains a
Link which
        onClick modifies the data.  What is the best way of telling the
DataView
        that the model has changed.  I've tried a few things, see the
comments
        in the code....

        Thanks for your help,
        Tim

                DataView dataView = new DataView("tasks",
                                        new UserTaskDataProvider(user))
{

                                protected void populateItem(final Item
item) {
                                        final TaskInstance task =
(TaskInstance)
        item.getModelObject();

                                        item.add(new Label("taskName",
        task.getName()));

                                        // add a link that, when
clicked,
        assigns the task back to
                                        // the group
                                        Link assignLink = new
Link("assignLink")
        {
                                                @Override
                                                public void onClick() {

        ATMInstallsDao.getFromApplicationContext()

        .assignTaskToGroup(task.getId(),

        "InstallsTeam");


//-------------PLEASE
        HELP WITH THIS BIT---------



                                                        // tell wicket
that
        we've changed the model so it
                                                        // updates the
page

                                                        //tried.......

                                                        //
modelChanged(); -
        does nothing (the Link objects model??)
                                                        //
        DataView.this.modelChanged(); - does not compile no DataView
parent???
                                                        // This works
but is not
        really the most efficient!.....

        getRequestCycle().setResponsePage(new UserTasksPage(userName));





        //------------------------------------------------

                                                }
                                        };
                                        assignLink.add(new
        Label("assignLinkLabel",
                                                        "assign to
group"));
                                        item.add(assignLink);


                                }
                        };


________________________________________________________________________

        The Information contained in this e-mail message is intended
only for
        the individuals named above. If you are not the intended
recipient,
        you should be aware that any dissemination, distribution,
forwarding
        or other duplication of this communication is strictly
prohibited.
        The views expressed in this e-mail are those of the individual
        author and not necessarily those of LINK Interchange Network
Ltd.
        Prior to taking any action based upon this e-mail message you
should
        seek appropriate confirmation of its authenticity. If you have
        received this e-mail in error, please notify the sender
immediately.

________________________________________________________________________


------------------------------------------------------------------------
-
        Take Surveys. Earn Cash. Influence the Future of IT
        Join SourceForge.net's Techsay panel and you'll get the chance
to share your
        opinions on IT & business topics through brief surveys - and
earn cash

http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE
V
        _______________________________________________
        Wicket-user mailing list
        Wicket-user@lists.sourceforge.net
        https://lists.sourceforge.net/lists/listinfo/wicket-user
<https://lists.sourceforge.net/lists/listinfo/wicket-user>




________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com
________________________________________________________________________
LINK Information Security


________________________________________________________________________
The Information contained in this e-mail message is intended only for
the individuals named above. If you are not the intended recipient,
you should be aware that any dissemination, distribution, forwarding
or other duplication of this communication is strictly prohibited.
The views expressed in this e-mail are those of the individual
author and not necessarily those of LINK Interchange Network Ltd.
Prior to taking any action based upon this e-mail message you should
seek appropriate confirmation of its authenticity. If you have
received this e-mail in error, please notify the sender immediately.
________________________________________________________________________

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to