Re: Checkbox filtering a dataview
Thanks. That makes a lot of sense. Sometimes the simplest approaches are the ones I forget. Matt igor.vaynberg wrote: 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 -- View this message in context: http://www.nabble.com/Checkbox-filtering-a-dataview-tp21839427p21851525.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
Checkbox filtering a dataview
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
Re: Checkbox filtering a dataview
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
Re: Checkbox filtering a dataview
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
Re: Checkbox filtering a dataview
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
RE: Checkbox filtering a dataview
Pass your data provider an instance of IModelBoolean. That way it is agnostic as to where it's getting the switch from. Jeremy Thomerson http://www.wickettraining.com -- sent from a wireless device -Original Message- From: Matt Welch matt...@welchkin.net Sent: Wednesday, February 04, 2009 1:51 PM To: users@wicket.apache.org Subject: Re: Checkbox filtering a dataview 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