public mypage extends webpage { private boolean filter; public mypage() { add(new dataview("dataview", new dataprovider()) {....}); }
private class dataprovider extends mydataprovider { protected boolean getfilter() { return filter; } } } On Wed, Feb 4, 2009 at 1:51 PM, Matt Welch <matt...@welchkin.net> wrote: > > Thank you for your reply. Unfortunately (for this situation, anyway), we > frequently reuse our dataproviders in more than one place in the > application, so they are are always in their own class files. In any case, > what we have will work for now. I'll look around through the examples for > other use cases. > > Matt > > > > igor.vaynberg wrote: >> >> public mypage extends webpage { >> private boolean filter; >> >> public mypage() { >> add(new dataview("dataview", new dataprovider()) {....}); >> } >> >> private class dataprovider implements idataprovider() { >> public int size() { return new query(filter).size(); } >> public iterator iterator() { return new query(filter).iterator(); } >> } >> } >> >> -igor >> >> >> On Wed, Feb 4, 2009 at 12:55 PM, Matt Welch <matt...@welchkin.net> wrote: >>> >>> I'm probably thinking about his all wrong, but for some reason I can't >>> get my >>> mind in the right frame here. I have a page with a dataview that is >>> showing >>> data in a table. That dataview needs to be filtered by a checkbox in a >>> different place on same page. The model for that checkbox is an attribute >>> of >>> the page (using PropertyModel). When I click the checkbox the page needs >>> to >>> refresh and show filtered data. Obviously the dataview need to know the >>> current value of that checkbox. The only way I can think to do that is to >>> pass the page itself to the dataview so that it can call the getter for >>> that >>> property. This seems convoluted, however. Am I missing something? >>> -- >>> View this message in context: >>> http://www.nabble.com/Checkbox-filtering-a-dataview-tp21839427p21839427.html >>> Sent from the Wicket - User mailing list archive at Nabble.com. >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> >> > > -- > View this message in context: > http://www.nabble.com/Checkbox-filtering-a-dataview-tp21839427p21840403.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org