You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Rafa Pérez <ra...@gmail.com> on 2009/05/11 15:09:29 UTC

[Trinidad] Problems with tr:table SelectionEvent

Hi all,

I need to distinguish between a SelectionEvent delivered when a checkbox is
ckecked or when 'Select all' or 'Select None' is clicked. I have been
looking into the code and the examples but have not found anything yet (I am
surprised that nobody ever needed this feature...).

I have been looking at the internals (javascript) and it seems that there is
a hidden input in the generated HTML that has a value "all" or "none" for
this purpose. However, when the form is submited in the PPR event, all its
hidden fields are cleared and thus, this hidden field never sends its value
to the server. Am I wrong? Is this working as it is supposed? Is there any
way I can know if the event was generated by clicking the links or the
checkbox?

TIA,

-- Rafa

Re: [Trinidad] Problems with tr:table SelectionEvent

Posted by Rafa Pérez <ra...@gmail.com>.
Any comments on this?

2009/5/12 Rafa Pérez <ra...@gmail.com>

> Yes, I thought about this, but if there is only one element in the table
> (only one result for a search or only one element in the current page of the
> navigation range), you can not know what happened... Any hints?
>
> Thanks,
>
> -- Rafa
>
>
> On Tue, May 12, 2009 at 10:06 AM, Marco Grimm-2 <
> Marco.Grimm@rz-service-mannheim.de> wrote:
>
>>
>> Did you have a look at the SelectionEvent? It (or exactly: its super
>> class)
>> has methods "getAddedSet()" and "getRemovedSet()". Maybe you can check
>> whether the size of the set is > 1 and can infer by that, whether only one
>> item was checked/unchecked or 'select one' or 'select none' was clicked.
>>
>> Regards, Marco
>>
>>
>> Rafa Pérez wrote:
>> >
>> > I need to distinguish between a SelectionEvent delivered when a checkbox
>> > is
>> > ckecked or when 'Select all' or 'Select None' is clicked. I have been
>> > looking into the code and the examples but have not found anything yet
>> (I
>> > am
>> > surprised that nobody ever needed this feature...).
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/-Trinidad--Problems-with-tr%3Atable-SelectionEvent-tp23483014p23497998.html
>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>
>>
>

Re: [Trinidad] Problems with tr:table SelectionEvent

Posted by Rafa Pérez <ra...@gmail.com>.
Yes, I thought about this, but if there is only one element in the table
(only one result for a search or only one element in the current page of the
navigation range), you can not know what happened... Any hints?

Thanks,

-- Rafa

On Tue, May 12, 2009 at 10:06 AM, Marco Grimm-2 <
Marco.Grimm@rz-service-mannheim.de> wrote:

>
> Did you have a look at the SelectionEvent? It (or exactly: its super class)
> has methods "getAddedSet()" and "getRemovedSet()". Maybe you can check
> whether the size of the set is > 1 and can infer by that, whether only one
> item was checked/unchecked or 'select one' or 'select none' was clicked.
>
> Regards, Marco
>
>
> Rafa Pérez wrote:
> >
> > I need to distinguish between a SelectionEvent delivered when a checkbox
> > is
> > ckecked or when 'Select all' or 'Select None' is clicked. I have been
> > looking into the code and the examples but have not found anything yet (I
> > am
> > surprised that nobody ever needed this feature...).
> >
>
> --
> View this message in context:
> http://www.nabble.com/-Trinidad--Problems-with-tr%3Atable-SelectionEvent-tp23483014p23497998.html
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>

Re: [Trinidad] Problems with tr:table SelectionEvent

Posted by Marco Grimm-2 <Ma...@rz-service-mannheim.de>.
Did you have a look at the SelectionEvent? It (or exactly: its super class)
has methods "getAddedSet()" and "getRemovedSet()". Maybe you can check
whether the size of the set is > 1 and can infer by that, whether only one
item was checked/unchecked or 'select one' or 'select none' was clicked.

Regards, Marco


Rafa Pérez wrote:
> 
> I need to distinguish between a SelectionEvent delivered when a checkbox
> is
> ckecked or when 'Select all' or 'Select None' is clicked. I have been
> looking into the code and the examples but have not found anything yet (I
> am
> surprised that nobody ever needed this feature...).
> 

-- 
View this message in context: http://www.nabble.com/-Trinidad--Problems-with-tr%3Atable-SelectionEvent-tp23483014p23497998.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.