Table.setValue vs. cursor selection

Trying to select a row programmatically using setValue. The row identified by the setValue is highlighted in blue in the attached screen shot. A getValue also returns that value. However, you can also see that the first row has an dotted outline and if you use the arrow keys to navigate (table is focused), the starting position for navigation is the dotted row, not the inverted one (as we need and expected). Multi-select is not on, immediate is.

Any help on how to do this would be appreciated.
12017.png

Wild guess: try also select(id), it might put the keyboard focus on this element.

Thanks for the guess - we tried it and it acts exactly the same.

There seems to be no difference between setValue() and select().

It appears that the dotted selection is an artifact of the javascript table which is improperly synced with the host. The only thing that seems to use that position is the keyboard. We could try to intercept the key press (up and down arrows) but that seems to defeat the purpose of the thin client.

Probably should put in a bug report for this. Any other insights are more than welcome!

There are different opinions on whether the general focus position (which is in some ways “transient” state of the browser rather than application state) should be sent to the server and preserved or not.

However, when selecting an item in a table, I agree it would be logical for the focus to be transferred to the selected item, especially if the table is focused and in single select mode and the newly selected item is visible, and maybe with somewhat looser conditions. Probably worth an enhancement request, at least.

Put it in as a bug (http://dev.vaadin.com/ticket/7909) as it seems that if you are going to allow the table to be focused and use the keyboard to navigate it (which it does) and that you can also select an item within code (which is also does), then you should be starting at the actually selected item vs. the item last selected by mouse click.

Our application is a desktop (needed to have it be able to cross platforms - PC vs Mac or whatever) and want to use keyboard options as much as possible.

hi all,

i have the same problem, what is happened with this ticket ?

our application could be handled with keyboard only ( production prozess is a killer for a mouse :slight_smile: )

have someone an idea or a solution ?

best regards
Alf

Got no response on the bug - got no additional response on the forum post (other than a new post with the same problem we are still encountering)

Continuing work on this project and went to check on the status of our bug (#7909 was what it was given when we added it - did a sample program with code as well) and it’s gone.

We have updated to the latest build of vaadin and it’s not been fixed so wondering what’s up…

I have this problem too. In my case I created shortcut to edit current selected row in table. When user click cancel (keyboard ESC shortcut) then I’m doing rollback on SQLContainer. On window close event I turn focus back on table that user can navigate without using mouse. But table is loosing “doted” focus to first visible row in table, but selected row is ok. I think this is due to the same bug in table. Any answer from vaadin developers came after that ticket? This is blocker issue for me.

You can see this issue in my simple example:

https://github.com/nonameplum/HelloWorld

I have the same problem with a generated column.

I implemented a LayoutClickListener on the component generated by generatedCell() method.
There I could invoke table.select() method and and have my row selected, but focus doesn’t move from the first row.

Any answer to #7909 ticket?

I have added my example project where you can see doted focus issue.

Please look into that ticket
http://dev.vaadin.com/ticket/7909

Bump.
Can somebody review that ticket?

Hi, i´m having the same problem here. Any chance to have this enhancement in 7.0.0 or 7.0.1 at least?

Regards,

Fabiano

The same thing happens in Tree also,
(I found this thread looking for solution in my Tree case)