[richfaces-issues] [JBoss JIRA] (RF-10793) ExtendedDataTable selection with Ctrl+click does not correctly update selection backing bean without clicking first

David Lee (JIRA) jira-events at lists.jboss.org
Tue Jul 23 05:19:26 EDT 2013


    [ https://issues.jboss.org/browse/RF-10793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12791603#comment-12791603 ] 

David Lee edited comment on RF-10793 at 7/23/13 5:17 AM:
---------------------------------------------------------

Hi Guys,

The fix JavaScript will cause another issue,
if the table with dataScroller -- then the selection will be clean up when user switch the page.

So since I have the page stuff, I cannot add the "x" to do clean selection in backend.

When I try to figure out why the statement always goes wrong, 
I found the key of this problem might in TableSelectionRendererContributor.java:
for line 90
>>
    ClientSelection _oldClientSelection = (ClientSelection) table
                        .getAttributes().get(CLIENT_SELECTION);
<<

The _oldClientSelection never got update, so when the code checking for shouldRemoveFromSelection(),
always return false!
>>
    // Decide whether to remove new row to selection based on comparison with
        // old one
        public boolean shouldRemoveFromSelection(int i,
                ClientSelection oldSelection, ClientSelection newSelection) {
            return !newSelection.isReset()
                    && (!newSelection.isSelectAll() && (!newSelection.isSelected(i) && oldSelection
                            .isSelected(i)));
        }
<<

The oldSelection.isSelected( i ) always return false.
That cause the backend selection goes wrong.

Any workaround for this one?

By the way, I'm using 3.3.3Final
                
      was (Author: dlee606):
    Hi Guys,

The fix JavaScript will cause another issue,
if the table with dataScroller -- then the selection will be clean up when user switch the page.

So since I have the page stuff, I cannot add the "x" to do clean selection in backend.

When I try to figure out why the statement always goes wrong, 
I found the key of this problem might in TableSelectionRendererContributor.java:
for line 90
>>
    ClientSelection _oldClientSelection = (ClientSelection) table
                        .getAttributes().get(CLIENT_SELECTION);
<<

The _oldClientSelection never got update, so when the code checking for shouldRemoveFromSelection(),
always return false!
>>
    // Decide whether to remove new row to selection based on comparison with
        // old one
        public boolean shouldRemoveFromSelection(int i,
                ClientSelection oldSelection, ClientSelection newSelection) {
            return !newSelection.isReset()
                    && (!newSelection.isSelectAll() && (!newSelection.isSelected(i) && oldSelection
                            .isSelected(i)));
        }
<<

The oldSelection.isSelected( i ) always return false.
That cause the backend selection goes wrong.

Any workaround for this one?
                  
> ExtendedDataTable selection with Ctrl+click does not correctly update selection backing bean without clicking first
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: RF-10793
>                 URL: https://issues.jboss.org/browse/RF-10793
>             Project: RichFaces
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: component-tables
>    Affects Versions: 3.3.3.Final
>         Environment: OS: SLES 10 SP2
> JBoss EAP 4.3.0.GA_CP03
> Application using JBoss Seam 2.1.2
>            Reporter: Eduard Ereza
>              Labels: extendedDataTable, richfaces, richfaces-showcase, selection
>             Fix For: 3.Future
>
>         Attachments: extdt_solution.txt
>
>
> Selecting rows with Ctrl+click on extendedDataTable just after rendering it (first time or reRender) selects them in the backing bean, but then deselecting the same rows with Ctrl+click does not deselect them in the backing bean. The same happens if there is a selection when the component is rendered: then, deselecting a value deselects it from the backing bean, but selecting it again does not select it in the backing bean.
> When you click (without Ctrl) for the first time, everything works as it should.
> This is also reproduceable on RichFaces Live Demo: http://livedemo.exadel.com/richfaces-demo/richfaces/extendedDataTable.jsf (see Steps to Reproduce).
> This is probably related to RF-8681.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the richfaces-issues mailing list