Hello everyone,
Good day. Newbie here and hoping to get some help. I'm trying to add a feature within a VLF-ONE Reusable Part where a DropDown (PRIM_LIST.DropDown) would be able to signal an event when the Tab key is pressed. The goal is to be able to set the focus on another component (not the next component by Tab Order) when the user hits the said key. However, PRIM_LIST.DropDown does not have a KeyPress event that I could use to catch the Tab key. The List Column (PRIM_LIST.String/Number) does have a KeyPress event but for some reason I am unable to trigger it.
Any ideas? Thanks.
How to catch Tab key in PRIM_LIST.DropDown (VLF-ONE)
-
dannyoorburg
- Posts: 177
- Joined: Mon Jan 04, 2016 9:50 am
- Location: Australia
Re: How to catch Tab key in PRIM_LIST.DropDown (VLF-ONE)
Hi,
So why can't you just set the correct Tab Order?
Regards,
Danny
So why can't you just set the correct Tab Order?
Regards,
Danny
- Stewart Marshall
- Posts: 417
- Joined: Thu Nov 05, 2015 5:25 pm
Re: How to catch Tab key in PRIM_LIST.DropDown (VLF-ONE)
What you're effectively saying is that two different controls will be able to "tab" to the same control i.e. The drop down or the control that is actually the one immediately before your target control.
From a UI design POV this is typically considered to be something best avoided, particularly because Shift+Tab won't take you back to where you came from half the time.
If you really want to do it though, you can turn TabStop off for the controls that are in the way when the DD gets focus, and then turn it back on when it loses focus.
From a UI design POV this is typically considered to be something best avoided, particularly because Shift+Tab won't take you back to where you came from half the time.
If you really want to do it though, you can turn TabStop off for the controls that are in the way when the DD gets focus, and then turn it back on when it loses focus.
Re: How to catch Tab key in PRIM_LIST.DropDown (VLF-ONE)
It will be used in a generic, ancestor-type component and the target object (i.e., the "next" component after hitting Tab) could be anything that can receive focus.dannyoorburg wrote: So why can't you just set the correct Tab Order?
The target object is variable, only known at run time, and is dependent on previous input. So yes, that's one way of putting it. This is also the requirement as I understand it.Stewart Marshall wrote:What you're effectively saying is that two different controls will be able to "tab" to the same control i.e. The drop down or the control that is actually the one immediately before your target control.
Hmmm this is different than the feature being requested but could be a possible solution. I'll look into it.Stewart Marshall wrote: From a UI design POV this is typically considered to be something best avoided, particularly because Shift+Tab won't take you back to where you came from half the time.
If you really want to do it though, you can turn TabStop off for the controls that are in the way when the DD gets focus, and then turn it back on when it loses focus.
Thanks for your responses; I appreciate it. If anyone else have an idea I'm all ears.
- Stewart Marshall
- Posts: 417
- Joined: Thu Nov 05, 2015 5:25 pm
Re: How to catch Tab key in PRIM_LIST.DropDown (VLF-ONE)
There is no way of stopping the Tab key working the way Tab is intended to work, other than by manipulating the TabStop and TabPosition properties of other components.
But what I still don't understand is this. If it's so important that tabbing away from the dropdown goes to a specific control, why isn't that control the next in the tab sequence?
But what I still don't understand is this. If it's so important that tabbing away from the dropdown goes to a specific control, why isn't that control the next in the tab sequence?
Re: How to catch Tab key in PRIM_LIST.DropDown (VLF-ONE)
This is what I've done on a similar component containing an input field: The component waits for the Tab key on the field's KeyPress event and Signals out an Event when the key is pressed. The container application is waiting for this Event to occur and performs the actions as necessary.Stewart Marshall wrote:There is no way of stopping the Tab key working the way Tab is intended to work, other than by manipulating the TabStop and TabPosition properties of other components.
As I mentioned earlier, the 'next' control is not specific - it could be any control that has a SetFocus method. Tabbing away is important because I'm using it as a signal to perform application-specific calculations.Stewart Marshall wrote:But what I still don't understand is this. If it's so important that tabbing away from the dropdown goes to a specific control, why isn't that control the next in the tab sequence?
- Stewart Marshall
- Posts: 417
- Joined: Thu Nov 05, 2015 5:25 pm
Re: How to catch Tab key in PRIM_LIST.DropDown (VLF-ONE)
If the user uses the tab key to leave the field you perform some calculations. What if they just click somewhere else?vegeta wrote:Tabbing away is important because I'm using it as a signal to perform application-specific calculations.
For the behaviour you're describing, LostFocus or perhaps the the Changed event would be a far more appropriate trigger, depending on the nature of the work being done.
EPC 141010 will introduce the KeyPress event for DropDown. This will be available very soon.
Re: How to catch Tab key in PRIM_LIST.DropDown (VLF-ONE)
I have a button that does the said calculation. The goal is to perform the same calculation when you press Tab as well.Stewart Marshall wrote: If the user uses the tab key to leave the field you perform some calculations. What if they just click somewhere else?
It's very easy to lose Focus on a component or trigger the Changed event. The calculation takes quite some time so it's not something that is ideal to trigger unnecessarily (stated differently, the user must have the intention of hitting Tab with the same intention of hitting the calculate button).Stewart Marshall wrote: For the behaviour you're describing, LostFocus or perhaps the the Changed event would be a far more appropriate trigger, depending on the nature of the work being done.
That's great.Stewart Marshall wrote: EPC 141010 will introduce the KeyPress event for DropDown. This will be available very soon.
- Stewart Marshall
- Posts: 417
- Joined: Thu Nov 05, 2015 5:25 pm
Re: How to catch Tab key in PRIM_LIST.DropDown (VLF-ONE)
I can safely say, I've never heard of a UI where tabbing out of a field is the equivalent of a button click.
I've seen a function key on the VERY odd occasion, but the norm is to use Enter.
I've seen a function key on the VERY odd occasion, but the norm is to use Enter.