Re: PageableListView and Detachable Models
>implement your own List interface Just in case if anyone not aware of, you only need to implement the size() and get(int index) methods of the List interface, everything else can just be unsupported. On Mon, Jun 23, 2008 at 2:21 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > well, thats part of the problem with listview :) > > see idataprovider and dataview > > if you do want to use listview then you have to implement your own > List interface that loads windows of data at a time depending on which > get(index) is used. > > -igor > > On Mon, Jun 23, 2008 at 2:16 PM, Jürgen Lind <[EMAIL PROTECTED]> > wrote: > > Ok, but since I pass the model into the constructor of the listview, how > > is the model informed which part of the data to load? Is there a method > > that I have been missing? > > > > J. > > > > Igor Vaynberg wrote: > >> > >> the model can be aware that it is used by the listview. the separation > >> here is that the listview is unaware of where or how its list is > >> built. > >> > >> for database stuff i prefer using dataview, it has database semantics > >> more closely built into it. > >> > >> -igor > >> > >> On Mon, Jun 23, 2008 at 1:55 PM, Jürgen Lind <[EMAIL PROTECTED]> > >> wrote: > >>> > >>> Hi, > >>> > >>> I am still a bit confused about one thing in the remark below: how can > >>> the model of the list view return the required items? Should not the > >>> model > >>> be unaware that it is used by a list view? > >>> > >>> J. > >>> > > in that case store the list of ids in your resultset as > > a property of the page. the model of the listview can then retrieve > > the subset of this list (based on the current page and number of > items > > needed) and do a select from foo where id in ( subset of id list ) > > query to retrieve the current window of data. > >>> > >>> -- > >>> Dr. Jürgen Lind > >>> iteratec GmbHFon: +49 (0)89 614551-44 > >>> Inselkammerstrasse 4 Fax: +49 (0)89 614551-10 > >>> 82008 Unterhaching Web: www.iteratec.de > >>> > >>> Sitz und Registergericht der iteratec GmbH: München HRB 113 519 > >>> Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf > Menzel > >>> > >>> > >>> - > >>> To unsubscribe, e-mail: [EMAIL PROTECTED] > >>> For additional commands, e-mail: [EMAIL PROTECTED] > >>> > >>> > >> > >> - > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> > > > > -- > > Mit freundlichen Grüßen, > > > > Jürgen Lind > > > > -- > > Dr. Jürgen Lind > > iteratec GmbHFon: +49 (0)89 614551-44 > > Inselkammerstrasse 4 Fax: +49 (0)89 614551-10 > > 82008 Unterhaching Web: www.iteratec.de > > > > Sitz und Registergericht der iteratec GmbH: München HRB 113 519 > > Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: PageableListView and Detachable Models
well, thats part of the problem with listview :) see idataprovider and dataview if you do want to use listview then you have to implement your own List interface that loads windows of data at a time depending on which get(index) is used. -igor On Mon, Jun 23, 2008 at 2:16 PM, Jürgen Lind <[EMAIL PROTECTED]> wrote: > Ok, but since I pass the model into the constructor of the listview, how > is the model informed which part of the data to load? Is there a method > that I have been missing? > > J. > > Igor Vaynberg wrote: >> >> the model can be aware that it is used by the listview. the separation >> here is that the listview is unaware of where or how its list is >> built. >> >> for database stuff i prefer using dataview, it has database semantics >> more closely built into it. >> >> -igor >> >> On Mon, Jun 23, 2008 at 1:55 PM, Jürgen Lind <[EMAIL PROTECTED]> >> wrote: >>> >>> Hi, >>> >>> I am still a bit confused about one thing in the remark below: how can >>> the model of the list view return the required items? Should not the >>> model >>> be unaware that it is used by a list view? >>> >>> J. >>> > in that case store the list of ids in your resultset as > a property of the page. the model of the listview can then retrieve > the subset of this list (based on the current page and number of items > needed) and do a select from foo where id in ( subset of id list ) > query to retrieve the current window of data. >>> >>> -- >>> Dr. Jürgen Lind >>> iteratec GmbHFon: +49 (0)89 614551-44 >>> Inselkammerstrasse 4 Fax: +49 (0)89 614551-10 >>> 82008 Unterhaching Web: www.iteratec.de >>> >>> Sitz und Registergericht der iteratec GmbH: München HRB 113 519 >>> Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel >>> >>> >>> - >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> > > -- > Mit freundlichen Grüßen, > > Jürgen Lind > > -- > Dr. Jürgen Lind > iteratec GmbHFon: +49 (0)89 614551-44 > Inselkammerstrasse 4 Fax: +49 (0)89 614551-10 > 82008 Unterhaching Web: www.iteratec.de > > Sitz und Registergericht der iteratec GmbH: München HRB 113 519 > Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PageableListView and Detachable Models
Ok, but since I pass the model into the constructor of the listview, how is the model informed which part of the data to load? Is there a method that I have been missing? J. Igor Vaynberg wrote: the model can be aware that it is used by the listview. the separation here is that the listview is unaware of where or how its list is built. for database stuff i prefer using dataview, it has database semantics more closely built into it. -igor On Mon, Jun 23, 2008 at 1:55 PM, Jürgen Lind <[EMAIL PROTECTED]> wrote: Hi, I am still a bit confused about one thing in the remark below: how can the model of the list view return the required items? Should not the model be unaware that it is used by a list view? J. in that case store the list of ids in your resultset as a property of the page. the model of the listview can then retrieve the subset of this list (based on the current page and number of items needed) and do a select from foo where id in ( subset of id list ) query to retrieve the current window of data. -- Dr. Jürgen Lind iteratec GmbHFon: +49 (0)89 614551-44 Inselkammerstrasse 4 Fax: +49 (0)89 614551-10 82008 Unterhaching Web: www.iteratec.de Sitz und Registergericht der iteratec GmbH: München HRB 113 519 Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Mit freundlichen Grüßen, Jürgen Lind -- Dr. Jürgen Lind iteratec GmbHFon: +49 (0)89 614551-44 Inselkammerstrasse 4 Fax: +49 (0)89 614551-10 82008 Unterhaching Web: www.iteratec.de Sitz und Registergericht der iteratec GmbH: München HRB 113 519 Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PageableListView and Detachable Models
the model can be aware that it is used by the listview. the separation here is that the listview is unaware of where or how its list is built. for database stuff i prefer using dataview, it has database semantics more closely built into it. -igor On Mon, Jun 23, 2008 at 1:55 PM, Jürgen Lind <[EMAIL PROTECTED]> wrote: > Hi, > > I am still a bit confused about one thing in the remark below: how can > the model of the list view return the required items? Should not the model > be unaware that it is used by a list view? > > J. > >>> in that case store the list of ids in your resultset as >>> a property of the page. the model of the listview can then retrieve >>> the subset of this list (based on the current page and number of items >>> needed) and do a select from foo where id in ( subset of id list ) >>> query to retrieve the current window of data. > > -- > Dr. Jürgen Lind > iteratec GmbHFon: +49 (0)89 614551-44 > Inselkammerstrasse 4 Fax: +49 (0)89 614551-10 > 82008 Unterhaching Web: www.iteratec.de > > Sitz und Registergericht der iteratec GmbH: München HRB 113 519 > Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PageableListView and Detachable Models
Hi, I am still a bit confused about one thing in the remark below: how can the model of the list view return the required items? Should not the model be unaware that it is used by a list view? J. in that case store the list of ids in your resultset as a property of the page. the model of the listview can then retrieve the subset of this list (based on the current page and number of items needed) and do a select from foo where id in ( subset of id list ) query to retrieve the current window of data. -- Dr. Jürgen Lind iteratec GmbHFon: +49 (0)89 614551-44 Inselkammerstrasse 4 Fax: +49 (0)89 614551-10 82008 Unterhaching Web: www.iteratec.de Sitz und Registergericht der iteratec GmbH: München HRB 113 519 Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PageableListView and Detachable Models
Hi Igor, thanks for your reply. Igor Vaynberg wrote: detach() is indeed called in the end of every request. what exactly is your requirement? you want to run the query once, upon page entry, and then always reuse the same resultset without doing another query? This is indeed what I would like to do. However, my current approach is to keep to original result list in memory and do the paging on the list without further database queries. I might try that option later, currently I am doing some kind of exploration of how to do things in wicket to derive a more or less generic architecture for our wicket projects. Cheers, J. in that case store the list of ids in your resultset as a property of the page. the model of the listview can then retrieve the subset of this list (based on the current page and number of items needed) and do a select from foo where id in ( subset of id list ) query to retrieve the current window of data. -igor On Mon, Jun 23, 2008 at 11:25 AM, Jürgen Lind <[EMAIL PROTECTED]> wrote: Hi, I a currently a bit stuck in dealing with a PageableListView and a detachable model. I have build my own model that wraps a list of search results that should exists as long as the page remains the same, i.e. across all requests that go to the same page such as for navigation or sort actions. As soon as the page is left, e.g. when the user navigates to the "details" page of a certain result, the search result list is cleared. However, it appears that the "detach" method is called immediately after the PageableListView is rendered, i.e. at the end of each request. Is this observation correct? And how would I deal with a requirement as described above? Cheers, J. -- Dr. Jürgen Lind iteratec GmbHFon: +49 (0)89 614551-44 Inselkammerstrasse 4 Fax: +49 (0)89 614551-10 82008 Unterhaching Web: www.iteratec.de Sitz und Registergericht der iteratec GmbH: München HRB 113 519 Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Mit freundlichen Grüßen, Jürgen Lind -- Dr. Jürgen Lind iteratec GmbHFon: +49 (0)89 614551-44 Inselkammerstrasse 4 Fax: +49 (0)89 614551-10 82008 Unterhaching Web: www.iteratec.de Sitz und Registergericht der iteratec GmbH: München HRB 113 519 Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PageableListView and Detachable Models
detach() is indeed called in the end of every request. what exactly is your requirement? you want to run the query once, upon page entry, and then always reuse the same resultset without doing another query? in that case store the list of ids in your resultset as a property of the page. the model of the listview can then retrieve the subset of this list (based on the current page and number of items needed) and do a select from foo where id in ( subset of id list ) query to retrieve the current window of data. -igor On Mon, Jun 23, 2008 at 11:25 AM, Jürgen Lind <[EMAIL PROTECTED]> wrote: > Hi, > > I a currently a bit stuck in dealing with a PageableListView and a > detachable > model. I have build my own model that wraps a list of search results that > should > exists as long as the page remains the same, i.e. across all requests that > go > to the same page such as for navigation or sort actions. As soon as the page > is > left, e.g. when the user navigates to the "details" page of a certain > result, > the search result list is cleared. > > However, it appears that the "detach" method is called immediately after the > PageableListView is rendered, i.e. at the end of each request. Is this > observation correct? And how would I deal with a requirement as described > above? > > Cheers, > > J. > > > -- > Dr. Jürgen Lind > iteratec GmbHFon: +49 (0)89 614551-44 > Inselkammerstrasse 4 Fax: +49 (0)89 614551-10 > 82008 Unterhaching Web: www.iteratec.de > > Sitz und Registergericht der iteratec GmbH: München HRB 113 519 > Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
PageableListView and Detachable Models
Hi, I a currently a bit stuck in dealing with a PageableListView and a detachable model. I have build my own model that wraps a list of search results that should exists as long as the page remains the same, i.e. across all requests that go to the same page such as for navigation or sort actions. As soon as the page is left, e.g. when the user navigates to the "details" page of a certain result, the search result list is cleared. However, it appears that the "detach" method is called immediately after the PageableListView is rendered, i.e. at the end of each request. Is this observation correct? And how would I deal with a requirement as described above? Cheers, J. -- Dr. Jürgen Lind iteratec GmbHFon: +49 (0)89 614551-44 Inselkammerstrasse 4 Fax: +49 (0)89 614551-10 82008 Unterhaching Web: www.iteratec.de Sitz und Registergericht der iteratec GmbH: München HRB 113 519 Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]