You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Matt Welch <ma...@welchkin.net> on 2009/02/04 21:55:30 UTC
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-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Checkbox filtering a dataview
Posted by Matt Welch <ma...@welchkin.net>.
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 <ma...@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 <ma...@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-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@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-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@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-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Checkbox filtering a dataview
Posted by Igor Vaynberg <ig...@gmail.com>.
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 <ma...@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 <ma...@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-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@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-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Checkbox filtering a dataview
Posted by Matt Welch <ma...@welchkin.net>.
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 <ma...@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-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@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-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Checkbox filtering a dataview
Posted by Igor Vaynberg <ig...@gmail.com>.
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 <ma...@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-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org