cancel
Showing results for 
Search instead for 
Did you mean: 

How to keep content selection on double-click in table cell?

nicolas_busson
Active Contributor
0 Kudos

Dear all,

Does anybody know a simple trick (without messing with SAP standard delivered javascript files) to be able to select the content of a cell by double-click in a table? You know: usually on any Web page you can double click on a word to select it and use Ctrl+C to copy the content... I find it far more convenient than passing over the field content with the mouse to select what I need.

Unfortunately (at least in SAP CRM7.0 EhP3) this is NOT something you can do in MULTISELECT or SINGLESELECT tables in WebUI (guess that's working for selection mode NONE only), because double-clicking in the cell content will trigger the whole row selection (RowSelectionByLineClick) and will lose the focus that you just set. Kindly see the following video for more details: Youtube - Table cell selection on double click doesn't work

I just got the confirmation from SAP support that it is the intended behavior: they disabled the cell content selection on double click to be able to navigate through the table cells with right and left arrows keys. I still don't know what you can do once you've navigated to a cell though...

So if anybody already found a simple trick to disable this rowselectionbylineclick function, or to keep the selection, that would be great! (maybe 's got a clue?).

Thanks a lot!

Nick.

PS: I just got the final word from SAP support: "the queries raised by you are consulting issues and falls outside the scope of Product support. Please refer to SAP Note 83020 for more details". So if anybody knows why this makes sense to navigate between cells without being able to copy their content, please tell me.

Accepted Solutions (1)

Accepted Solutions (1)

nicolas_busson
Active Contributor
0 Kudos

Hi,

I'm just wrapping everything up to be able to mark this thread as answered. In the end content selection by double-clicking table cells is not supported by SAP, and you have two options to enable this feature:

  1. Refactor the whole component logic to switch to frontend selection mode (see note 1318610 provided by Jean-Yves in one of the comments)
  2. Disable the rowselectionbylineclick via a customer modification in javascript file scripts_.oo_tableview.js. But becareful: the latter will make it impossible to select a line in a table in case no row-selector is provided (we saw that happen in some tree views for example).

Cheers,

Nick.

Answers (3)

Answers (3)

nicolas_busson
Active Contributor
0 Kudos

For the record: I just got another piece of information from SAP Support:

When navigating from cell to cell, the screen reader will read out the contents of the cell.  This is very important in order for WEBCUIF to comply with accessibility product standards

That's a very good point indeed!

So thank you for pointing this out: I'm glad you've finally came up with a relevant business case for those right & left arrows. However, when disabling the RowSelectionByLineClick which makes it possible to select content by double-clicking in a cell, navigation with left/right arrows is still possible so screen readers will work as well ;')

Cheers,

Nicolas.

jyguyomarch
Advisor
Advisor
0 Kudos

Hi Nicolas,

The only way I know is to enable the so called "Frontend selection" or "Fast selection" mode for a given table. And that's probably what Naresh is experiencing as a lot of tableshave been switched to this mode in EhP2 and EhP3.

Basically this mode moves the selection logic to the frontend making the roundtrip caused by the "onRowSelection" attribute not necessary anymore. In this mode, if you double click on a row, the text will get selected and the row will quickly be selected and then unselected.

See note 1318610 to know how to switch this mode on.

But no magic here, if a table needs absolutely the old selection mode (with a roundtrip) then the text cannot be selected with a double click...

Regards - JYves

nicolas_busson
Active Contributor
0 Kudos

Hi Jean-Yves,

Thank you so much for chiming in! I'll check if we can switch to frontend selection, but as the corresponding screen deals with invoices, a lot of refactoring will be involved, so not sure this can be accepted (on the other hand we discovered that only 1 line of javascript code could be added to scripts_.oo_tableview.js in order to fix this behavior so we might take this path instead).

Anyway: as this doesn't seem to be considered a bug because removing content selection allows to navigate between cells with left/right arrows, by any chance do you know what it is for? I mean, what can you do once you've navigated to a cell? There must be a purpose for navigating... which one is it? As it doesn't make any sense to me at the moment to be able to surround a cell with dotted lines if I cannot do anything at all, I'm wondering why SAP chose the dotted lines instead of the content selection. There must be a good reason for removing something so widely used over the Internet: I'm looking desperately for this reason to be able to explain it to 3 customers of mine. So if you have the answer, I'm begging you to share it 🙂

Thank you so much,

nicolas.

jyguyomarch
Advisor
Advisor
0 Kudos

Hi Nicolas,

We did not remove the selection. The problem comes with the roundtrip that happens on selection. The dotted line appears because focus is set on the cell, and that's also standard behavior.

On a classic table, when you double click on a cell:

  • On the first click, the cell is focused (dotted line) and an event "RowSelected" is sent to the back end.
  • On the second click, text is selected as expected
  • But right after, response from the back end comes and refresh the page (selecting the row, enabling buttons etc...). And when the page is refreshed, the text selection is lost. So you don't have time to copy the text.

We can have a quick call to clarify that if you want.

And if you've found a one-liner javascript that solves this, don't hesitate to open a ticket on our component, maybe we can just add it to the standard

nicolas_busson
Active Contributor
0 Kudos

Hi Jean-Yves,

OK that makes sense. But then, imagine you don't care/need to select the corresponding row by clicking on any cell (because if you tell your users they can copy/paste any cell content by double-click, they'll be happy to use the selector at the beginning of each line if they have to): is there a way to achieve it without a lot of coding or customer modification?

Because actually that's what the one-liner we found in scripts_.oo_tableview.js is doing: it disables the row selection by line click (which successfully solved all those copy/paste issues). But I found it very doubtful that SAP doesn't provide a simpler/standard way of doing it as this is soooo common on a webpage to use double-click to select something...

Anyway, thanks again for the help you provided so far. Really appreciate it.

Cheers!

Nicolas.

PS: for anyone interested, here is the line I was talking about (Else... Return):

Former Member
0 Kudos

Hi Nicolas,

I am working on SAP CRM 7.0 EHP3 system and able to do the selection of table cell content by double click.

I tested this on the product's assignment block table view in campaigns and it is working fine.

Regards,

Naresh

nicolas_busson
Active Contributor
0 Kudos

Hi Naresh,

Thanks for the feedback. But may you please tell us if the selection is done:

1) In a table where selection mode is set to none ?

2) Or in a table where selection mode is set to multilineedit?

Because looking at SAP standard coding in the celletaror class, those are the only two examples that may work...

Best regards,

Nicolas.