Select LIST After SPIN NewSelection


#1

For controls setting a Browse filter value, often my code will immediately SELECT the just reset browse list to show/scroll the new query results.

However, when a SPIN is used as the filter value control, the SPIN control retains focus no matter what code I have tried for forcing selection of the browse list.

The attached test code shows the situation by essentially doing the following:

CASE EVENT()
OF EVENT:NewSelection
IF FIELD() = ?SPIN
L:SpinValue += 1
POST(EVENT:Accepted,?SPIN,True) ! Force ACCEPTED for ?SPIN
END
OF EVENT:Accepted
SELECT(?LIST)

END

Any suggestions?

SpinTest.zip (5.5 KB)


#2

Your example works if:

  1. Remove IMM from the listbox.
  2. (optional) Set ?List{PROP:Selected} to 1 after initializing Queue.

#3

Perhaps my explanation of desired behaviour was a bit short.

A new selection of the SPIN (click of H ScrollBar), does not result in focus moving to the list expected in the example code (w/ or w/o IMM on the list).


#4

When I scroll the spinbox, subsequent movements of the up/down arrow key on the keyboard work on the listbox.


#5

SpinTest.zip (777.9 KB)
Here it is if it helps any.


#6

The confusion regarding control focus is the SPIN control remains highlighted even though the LIST becomes scrollable. This is different from using tab to move from the spin control to the list - ie the spin does not stay highlighted.


#7

In C10, even if you set ?Spin{PROP:Selected} = -1, it still has a flashing cursor like you could start typing in that control. Seems like a bug.

I haven’t tried it in C11.