Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Setting Focus on Table to enable UP/DOWN keys for selection
Setting Focus on Table to enable UP/DOWN keys for selection [message #1018263] Wed, 13 March 2013 10:18 Go to next message
Markus Duft is currently offline Markus Duft
Messages: 60
Registered: February 2013
Member
Hi!

Maybe I'm doing something wrong, or miss something; I'm trying to setFocus() the focus on a Table, so that following key up/down presses will cause selection in the table. this however just does not work (we're using table in a custom drop down in another shell). When i add a key listener to the table, i get the according events correctly, just nobody evaluates them.

If i have a stand alone table, and manually focus it by clicking into it, up/down works as expected, but i noted that this is obviously handled on the client, not the server, because the selection happens even though i have a breakpoint in the event loop Smile

Any ideas?

Thanks!
Markus
Re: Setting Focus on Table to enable UP/DOWN keys for selection [message #1018824 is a reply to message #1018263] Thu, 14 March 2013 10:32 Go to previous messageGo to next message
Tim Buschtoens is currently offline Tim Buschtoens
Messages: 358
Registered: July 2009
Senior Member
Hi.

It would really help if you could post a snippet to reproduce the issue
and also tell us what RAP version and browser you are using.

Greetings,
Tim

Am 13.03.2013 15:18, schrieb Markus Duft:
> Hi!
>
> Maybe I'm doing something wrong, or miss something; I'm trying to
> setFocus() the focus on a Table, so that following key up/down presses
> will cause selection in the table. this however just does not work
> (we're using table in a custom drop down in another shell). When i add a
> key listener to the table, i get the according events correctly, just
> nobody evaluates them.
>
> If i have a stand alone table, and manually focus it by clicking into
> it, up/down works as expected, but i noted that this is obviously
> handled on the client, not the server, because the selection happens
> even though i have a breakpoint in the event loop :)
>
> Any ideas?
>
> Thanks!
> Markus

--
Tim Buschtöns

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Setting Focus on Table to enable UP/DOWN keys for selection [message #1018848 is a reply to message #1018824] Thu, 14 March 2013 11:10 Go to previous messageGo to next message
Markus Duft is currently offline Markus Duft
Messages: 60
Registered: February 2013
Member
i'm on a recent RAP 2.1.0 nightly (few days old), and the attached app demonstrates the problem. click the "click me!" which programmatically sets the focus to the table, and (without clicking into the table!) try to move selection up/down - doesn't work - bug or desired behaviour?
Re: Setting Focus on Table to enable UP/DOWN keys for selection [message #1018852 is a reply to message #1018848] Thu, 14 March 2013 11:15 Go to previous messageGo to next message
Markus Duft is currently offline Markus Duft
Messages: 60
Registered: February 2013
Member
hm. seems a setSelection(0) at the correct location "fixes" the problem. having "something" selected helps obiously. Interesting enough i did try this yesterday, and i was unable to get it to work in our application. I'm now setting the selection immediately after setFocus on the table if there is nothing selected - that helps.
Re: Setting Focus on Table to enable UP/DOWN keys for selection [message #1018866 is a reply to message #1018852] Thu, 14 March 2013 11:38 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1691
Registered: July 2009
Senior Member
Hi Markus,
keyboard navigation works if there is already focused item set and the
control is focused too. You could set the focus item by clicking on the
item or programmatically by setSelection. Note that the select() method
does not change the focus item, only setSelection().
Best,
Ivan

On 3/14/2013 5:15 PM, Markus Duft wrote:
> hm. seems a setSelection(0) at the correct location "fixes" the
> problem. having "something" selected helps obiously. Interesting
> enough i did try this yesterday, and i was unable to get it to work in
> our application. I'm now setting the selection immediately after
> setFocus on the table if there is nothing selected - that helps.

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Setting Focus on Table to enable UP/DOWN keys for selection [message #1103332 is a reply to message #1018866] Fri, 06 September 2013 12:29 Go to previous messageGo to next message
Arnaud MERGEY is currently offline Arnaud MERGEY
Messages: 111
Registered: March 2010
Location: France
Senior Member
Hello,
I think I hit a similar issue.

Even by setting focus on a table inside a dialog, it is not possible to use keyboard navigation, without clicking on the table.

I attached a snippet that reproduces the issue.

Best regards,
Arnaud
Re: Setting Focus on Table to enable UP/DOWN keys for selection [message #1104390 is a reply to message #1103332] Sun, 08 September 2013 04:58 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1691
Registered: July 2009
Senior Member
Hi Arnaud,
in order to use the keyboard navigation you need the focused item to be
set. Focused item is set by using Table#setSelection, but not with
Table#select. If I remember correctly, depends on virtuality of the
Table (VIRTUAL is set or not), select is used by TableViewer instead
setSelection. Please try getTableViewer().getTable().setSelection( 0 ).
Of course you could step into getTableViewer().setSelection and ensure
that Table#setSelection is used internally.
HTH,
Ivan

On 9/6/2013 7:29 PM, Arnaud MERGEY wrote:
> Hello,
> I think I hit a similar issue.
>
> Even by setting focus on a table inside a dialog, it is not possible to use keyboard navigation, without clicking on the table.
>
> I attached a snippet that reproduces the issue.
>
> Best regards,
> Arnaud

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Setting Focus on Table to enable UP/DOWN keys for selection [message #1104417 is a reply to message #1104390] Sun, 08 September 2013 06:02 Go to previous message
Arnaud MERGEY is currently offline Arnaud MERGEY
Messages: 111
Registered: March 2010
Location: France
Senior Member
Got it,
sorry I misunderstood your advice above, so I tried with setSelection on TableViewer instead of Table itself.
It seems that Table.setSelection is not used internally with TableViewer.setSelection.

Using Table.setSelection enables keyboard navigation.

Regards,
Arnaud
Previous Topic:Using Preferences in RAP
Next Topic:How to do a filter just like a tableviewer to Nebula Grid?
Goto Forum:
  


Current Time: Fri Apr 25 02:56:09 EDT 2014

Powered by FUDForum. Page generated in 0.02396 seconds