You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Yury Luneff <bi...@ya.ru> on 2010/04/15 15:35:07 UTC
multipage grid with "select all" button
Maybe the info is in this list, but I seem to be blind to that.
I want to make a grid of entities with checkbox column. That's easy --
jumpstart proposes "set..." that is called for each row so I could see
what rows are selected.
But I want also something to select all rows in a grid and select
none. The same way it is usually done in e-mail web interfaces. So
that i press "select all" -- i have checkboxes on on the same page
(that's easy, actually, just one jquery operator), but other pages of
the grid are untouched.
Did anyone solve this not so uncommon task?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: multipage grid with "select all" button
Posted by Yury Luneff <bi...@ya.ru>.
i'll see if ioko-tapestry-commons/tapestry-mixins/ BoundCheckBox helps
:)
Other ideas are in great welcome.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: multipage grid with "select all" button
Posted by Andreas Andreou <an...@di.uoa.gr>.
that's the fun part with cookies - you dont have to make them interact during
form submittion - they are sent to the server on every request (even
images, e.t.c.
of course that also has pitfalls... and explains why most high
traffic sites choose to server resources from a cookieless (sub)domain)!
On Fri, Apr 16, 2010 at 06:12, Yury Luneff <bi...@ya.ru> wrote:
>> i've done something like this once (outside tapestry) using cookies to store
>> the selections (which were basically the entity ids) - then added some js
>> to make each checkbox checked if needed.
>
>> This keeps each page's selections fine.
>
>> Additionally, as soon as a page's checkboxes are all checked, i would
>> detect that
>> in js and show a link "Select all other entries" which would store a
>> predifined value in
>> the cookie (you could use the word "all", because users where allowed
>> to filter my table,
>> I used a predifined prefix and the filter data)
>
> OK. Say we might do something like that in tapestry (actually,
> yesterday we've tried to do something like a ajax form submit whenever
> checkbox is checked, but thats bad). Suppose it's easy to add info to
> a cookie in onclick for a checkbox. How do I hook to form submission
> so I can put info from cookies to form submission? I'm only starting
> to see what Tapestry.js does so I don't quite have a clue about that.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: multipage grid with "select all" button
Posted by Yury Luneff <bi...@ya.ru>.
> i've done something like this once (outside tapestry) using cookies to store
> the selections (which were basically the entity ids) - then added some js
> to make each checkbox checked if needed.
> This keeps each page's selections fine.
> Additionally, as soon as a page's checkboxes are all checked, i would
> detect that
> in js and show a link "Select all other entries" which would store a
> predifined value in
> the cookie (you could use the word "all", because users where allowed
> to filter my table,
> I used a predifined prefix and the filter data)
OK. Say we might do something like that in tapestry (actually,
yesterday we've tried to do something like a ajax form submit whenever
checkbox is checked, but thats bad). Suppose it's easy to add info to
a cookie in onclick for a checkbox. How do I hook to form submission
so I can put info from cookies to form submission? I'm only starting
to see what Tapestry.js does so I don't quite have a clue about that.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: multipage grid with "select all" button
Posted by Andreas Andreou <an...@di.uoa.gr>.
i've done something like this once (outside tapestry) using cookies to store
the selections (which were basically the entity ids) - then added some js
to make each checkbox checked if needed.
This keeps each page's selections fine.
Additionally, as soon as a page's checkboxes are all checked, i would
detect that
in js and show a link "Select all other entries" which would store a
predifined value in
the cookie (you could use the word "all", because users where allowed
to filter my table,
I used a predifined prefix and the filter data)
On Thu, Apr 15, 2010 at 21:57, Matheus Eduardo Machado Moreira
<ma...@gmail.com> wrote:
> 2010/4/15 Thiago H. de Paula Figueiredo <th...@gmail.com>
>
>> On Thu, 15 Apr 2010 10:38:19 -0300, Yury Luneff <bi...@ya.ru> wrote:
>>
>> yes, sure, but you can't select elements by class that are physically
>>> not on this page now (another page of grid, both inline=true or false)
>>>
>>
>> Why would you want to select something that is not shown? It seems quite
>> error-prone and not intuitive to me.
>> I can't recall any website that does that.
>
>
> Gmail. :-)
>
>
>> In your case, you "select all" button must also use AJAX to send a
>> notification to the page so it can consider all objects selected.
>>
>> --
>> Thiago H. de Paula Figueiredo
>> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
>> and instructor
>> Owner, software architect and developer, Ars Machina Tecnologia da
>> Informação Ltda.
>> http://www.arsmachina.com.br
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> Atenciosamente,
>
> Matheus Eduardo Machado Moreira
> matheus.emm@gmail.com
>
> "Violence is the last refuge of the incompetent."
> Salvor Hardin (The Foundation, Isaac Asimov)
>
--
Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: multipage grid with "select all" button
Posted by Matheus Eduardo Machado Moreira <ma...@gmail.com>.
2010/4/15 Thiago H. de Paula Figueiredo <th...@gmail.com>
> On Thu, 15 Apr 2010 10:38:19 -0300, Yury Luneff <bi...@ya.ru> wrote:
>
> yes, sure, but you can't select elements by class that are physically
>> not on this page now (another page of grid, both inline=true or false)
>>
>
> Why would you want to select something that is not shown? It seems quite
> error-prone and not intuitive to me.
> I can't recall any website that does that.
Gmail. :-)
> In your case, you "select all" button must also use AJAX to send a
> notification to the page so it can consider all objects selected.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, software architect and developer, Ars Machina Tecnologia da
> Informação Ltda.
> http://www.arsmachina.com.br
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
Atenciosamente,
Matheus Eduardo Machado Moreira
matheus.emm@gmail.com
"Violence is the last refuge of the incompetent."
Salvor Hardin (The Foundation, Isaac Asimov)
Re: multipage grid with "select all" button
Posted by Yury Luneff <bi...@ya.ru>.
> i guess i just need a persisted property on the page of default
> selection value and use it in "get" property for checkbox value. And
> change this property from action link or smth. A page reload, but it
> seem to be right thing.
It is almost ok, but when grid switches pages, noone on server side
gets a notification about it.
I did something like that:
-- @Persist private Boolean defaultSelectState;
which is triggered on and off by 2 event handlers;
-- getSelected() which returns defaultSelectState;
i did both this simple way and the "complex" one with saving
Map<EntityId, Selected> for selections.
It is ok for rows that are on the same page that is opened, but as
soon as i just switch to another page -- it is bad :-) Even if i
return the value i've got from setSelected (through that map), noone
calls setSelected() to save grid page status when page switch is
performed.
I guess, I need
to do some kind of submit whenever grid pager link is used. Right? But
not the total form submit, but the one that just triggers setSelected
for all rows and nothing more.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: multipage grid with "select all" button
Posted by Yury Luneff <bi...@ya.ru>.
> i've meant not quite that, but it is close. The topic is "select all
> button" -- select all once, then user deselects uninteresting rows.
> For ex, there maybe 50 rows on two pages and user may want not to have
> just 2 or 3 of them in the report. So he presses "select all", all of
> 50 records on both pages are selected and then he deselects everything
> he does not need. And submits afterwards. Or he doesn't use that
> button (link) at all and selects just few of the records. So it is
> kinda like "change default value" for checkboxes in the grid while
> filling some form. Hm, it is possible with some page reloading, i
> guess.
i guess i just need a persisted property on the page of default
selection value and use it in "get" property for checkbox value. And
change this property from action link or smth. A page reload, but it
seem to be right thing.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: multipage grid with "select all" button
Posted by Yury Luneff <bi...@ya.ru>.
> On Thu, 15 Apr 2010 10:55:20 -0300, Yury Luneff <bi...@ya.ru> wrote:
>> I have rows i'd like to see in my report. Most probably, I would like
>> to select them all, but perhaps I just need to drop out some
>> uninteresting records (such as guys that already had their payment or
>> so). So that user would decide if he needs that record in the report,
>> but users starts with selected checkbox by default (and this is
>> optional, he may choose just few records).
> So just have your "select all" checkbox bound to a property in your page
> and ignore selections when this checkbox is set. Besides that, check all
> the other checkboxes.
i've meant not quite that, but it is close. The topic is "select all
button" -- select all once, then user deselects uninteresting rows.
For ex, there maybe 50 rows on two pages and user may want not to have
just 2 or 3 of them in the report. So he presses "select all", all of
50 records on both pages are selected and then he deselects everything
he does not need. And submits afterwards. Or he doesn't use that
button (link) at all and selects just few of the records. So it is
kinda like "change default value" for checkboxes in the grid while
filling some form. Hm, it is possible with some page reloading, i
guess.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: multipage grid with "select all" button
Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Thu, 15 Apr 2010 10:55:20 -0300, Yury Luneff <bi...@ya.ru> wrote:
> I have rows i'd like to see in my report. Most probably, I would like
> to select them all, but perhaps I just need to drop out some
> uninteresting records (such as guys that already had their payment or
> so). So that user would decide if he needs that record in the report,
> but users starts with selected checkbox by default (and this is
> optional, he may choose just few records).
So just have your "select all" checkbox bound to a property in your page
and ignore selections when this checkbox is set. Besides that, check all
the other checkboxes.
--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da
Informação Ltda.
http://www.arsmachina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: multipage grid with "select all" button
Posted by Yury Luneff <bi...@ya.ru>.
Actually use case is something like that:
I have rows i'd like to see in my report. Most probably, I would like
to select them all, but perhaps I just need to drop out some
uninteresting records (such as guys that already had their payment or
so). So that user would decide if he needs that record in the report,
but users starts with selected checkbox by default (and this is
optional, he may choose just few records).
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: multipage grid with "select all" button
Posted by Norman Franke <no...@myasd.com>.
I've actually done things like this for queries and adding a query to
a list of items to process. I have a checkbox to select all on the
screen, which is just pure Prototype javascript. I then have a link
called "add entire query" that re-runs the query and adds the results
to the queue. Works well and the users find it intuitive.
Norman Franke
Answering Service for Directors, Inc.
www.myasd.com
On Apr 15, 2010, at 9:43 AM, Thiago H. de Paula Figueiredo wrote:
> On Thu, 15 Apr 2010 10:38:19 -0300, Yury Luneff <bi...@ya.ru>
> wrote:
>
>> yes, sure, but you can't select elements by class that are physically
>> not on this page now (another page of grid, both inline=true or
>> false)
>
> Why would you want to select something that is not shown? It seems
> quite error-prone and not intuitive to me.
> I can't recall any website that does that. In your case, you "select
> all" button must also use AJAX to send a notification to the page so
> it can consider all objects selected.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant,
> developer, and instructor
> Owner, software architect and developer, Ars Machina Tecnologia da
> Informação Ltda.
> http://www.arsmachina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
Re: multipage grid with "select all" button
Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Thu, 15 Apr 2010 10:38:19 -0300, Yury Luneff <bi...@ya.ru> wrote:
> yes, sure, but you can't select elements by class that are physically
> not on this page now (another page of grid, both inline=true or false)
Why would you want to select something that is not shown? It seems quite
error-prone and not intuitive to me.
I can't recall any website that does that. In your case, you "select all"
button must also use AJAX to send a notification to the page so it can
consider all objects selected.
--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da
Informação Ltda.
http://www.arsmachina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: multipage grid with "select all" button
Posted by Yury Luneff <bi...@ya.ru>.
> Maybe the info is in this list, but I seem to be blind to that.
> I want to make a grid of entities with checkbox column. That's easy --
> jumpstart proposes "set..." that is called for each row so I could see
> what rows are selected.
> But I want also something to select all rows in a grid and select
> none. The same way it is usually done in e-mail web interfaces. So
> that i press "select all" -- i have checkboxes on on the same page
> (that's easy, actually, just one jquery operator), but other pages of
> the grid are untouched.
> Did anyone solve this not so uncommon task?
actually there is some info on this from Thiago, but...
"
You can rewrite a header cell using <t:parameter name="propertyNameHeader"> or
<p:propertyNameHeader>. The rest is implemented through JavaScript. Give each
controlled checkbox a CSS class then use Prototype's $$() function to find them.
"
yes, sure, but you can't select elements by class that are physically
not on this page now (another page of grid, both inline=true or false)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org