Key listener on Data Grid web component

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Key listener on Data Grid web component

Postby roddy » Thu Sep 23, 2021 7:00 am

I am trying to get the callback to fire on a Data Grid web component; the keylistener attribute has been added to the properties and linked to the plugins.keyListener.addKeyListener() in the onShow().

It is working on a field in a form that has a similar setup; can it also work for other components in intercepting key strokes as above?
roddy
 
Posts: 100
Joined: Mon Oct 26, 2020 12:32 am

Re: Key listener on Data Grid web component

Postby Gabi Boros » Thu Sep 23, 2021 9:45 am

where do you want to put the keylistener? on the component? so when focused you can handle a key event or on an editing cell of the grid? (cell editor)
Gabi Boros
Servoy
Gabi Boros
 
Posts: 399
Joined: Tue Jun 26, 2007 4:03 pm
Location: Timisoara, Romania

Re: Key listener on Data Grid web component

Postby roddy » Mon Sep 27, 2021 12:48 am

Ideally, we want keyboard shortcuts for the app. I am trying to add the key listener to the onShow() of a form (with the keylistener attribute on the form).

This is not necessarily about focus; for example, we are using the svy Navigation side bars and nav bar, the up and down arrows work on a list form but only when it is clicked on to set the focus. I couldn't find any way of setting (or requesting) the focus to anything except a field, so there was no way I could find to set the focus to the form. We would also like the Enter key to select a record on a list; pressing Enter does not currently do anything.

So, the upshot is being able to get the key listener to work on a form component, so we can implement the keyboard shortcuts requested for the Servoy app.
roddy
 
Posts: 100
Joined: Mon Oct 26, 2020 12:32 am

Re: Key listener on Data Grid web component

Postby Gabi Boros » Mon Sep 27, 2021 9:48 am

can't you just use the shortcut api from the window plugin for this?
Gabi Boros
Servoy
Gabi Boros
 
Posts: 399
Joined: Tue Jun 26, 2007 4:03 pm
Location: Timisoara, Romania

Re: Key listener on Data Grid web component

Postby roddy » Tue Sep 28, 2021 8:30 am

I had no idea this functionality existed, thanks for passing it on. Will give it a go :-)
roddy
 
Posts: 100
Joined: Mon Oct 26, 2020 12:32 am


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 7 guests