Picture Get Focus-trigger

Author: roger.wallin@abilita.fi (rogerw)

Hi, Uniface 9.7.01.02. I have a form that is used with a touch-screen. The data-input to the form is read by a code-reader and the focus should remain on the inputfield (small editbox). There is also a button which quits the form. Furthermore there are some Picture-fields and Editboxes (or NoEditBoxes) that are just used for showing data and info-pictures. To avoid that the Editboxes get focus, I have the following code in the GetFocus-triggers of the Editboxes $prompt=inputfield to put focus back on the inputfield. The same doesn't work for the pictures, ie. when the users touches a picture, the focus remains there and the inputfield won't have focus to get the next input from the code-reader. In another form (start-form), I have no button but just the inputfield and then I can solve it with "edit/nowander". Any ideas? Don't think too much about the touch-screen and code-reader, the same can be simulated with a keyboard and a mouse. I can't demand that the user should understand to put the focus back to the inputfield as it looses focus (think of ordinary people using an ATM). Regards RogerW.  PS. Hope I haven't missed something easy in a hurry Confused.

6 Comments

  1. Hi Roger, Are the image / picture fields defined with a NED,NPR setting? Knut


    Author: Knut (knut.dybendahl@gmail.com)
  2. Hi RogerW, I've tried to replicate the described behavior using just the keyboard and/or the mouse, but so far I did not succeed. Can you also replicate this issue on a machine without a touch-screen? Also, what kind of device are you using (something like Microsoft Surface or a device with Windows Mobile) and which Windows version? For my test I've just added a $prompt statement to the Field Gets Focus Trigger of the Picture field; e.g.

    $prompt=inputfield This seems to work in all cases. When you test this, is the Field Gets Focus Trigger of the Picture field not fired or is $prompt not working? Hope this helps. Regards, Daniel Iseli Uniface Technical Support


    Author: diseli (daniel.iseli@uniface.com)
  3. I personally think the edit/nowander in combination with Knut's suggestion should do the job and the '$prompt=' statements in the various <FGF> triggers should not be necessary.

    Quoting the documentation: /nowander—cursor keys (including next and previous screen) scroll the field contents and cannot be used to leave a field. When the form is used with the GUI driver, the mouse cannot be used to change the location of the cursor and automatic scroll bars are also disabled. Structure editor functions such as ^NEXT_FIELD, ^PREV_FIELD, and so on, work as normal. Only allowed in Execute trigger.

    Author: Arjen van Vliet (arjen.van.vliet@uniface.com)
  4. Hi, Knut, I have tried both, ie. empty Syntax and with "NED,NPR", no change. On the other hand, although the Syntax is set to "NED,NPR", whatever widget can be set focus to with the mouse. The syntax neither makes a difference in getting the FieldGetFocus to work for the Picture. Arjen, as I understand it I can't use "/nowander" as the user should be able to change focus to the quit-button. This quits the form,but before that focus should remain on inputfield.  Daniel, I just have a normal display, keyboard and mouse. The customers use a normal PC with some kind of big touch-screen. But as I said, don't concentrate on the device, I myself test it on a windows7 with a normal display and mouse. Putting a debug-statement into the FieldGetsFocus, shows that the trigger isn't activated at all. Interesting that you get it working. I have to try the same in Uniface 9.6, from which the application is migrated, and by building a new form. Regards RogerW.


    Author: rogerw (roger.wallin@abilita.fi)
  5. Hi, I added a new (Widget Type) Picture on another form and the FieldGetFocus worked at once. I compared the Field Properties and noticed that my old picture was set to Characteristics=Control and the new one to "Not in database". I changed the new picture to "Control" and then it's FieldGetsFocus didn't work anymore. I change my problem picture to "Not in database" and its FieldGetsFocus worked, but for some reason I couldn't see the picture anymore although the new picture showed well. Changing it to "Boilerplate" solved both problems!?! Regards RogerW.


    Author: rogerw (roger.wallin@abilita.fi)
  6. rogerw said Hi, I added a new (Widget Type) Picture on another form and the FieldGetFocus worked at once. I compared the Field Properties and noticed that my old picture was set to Characteristics=Control and the new one to "Not in database". I changed the new picture to "Control" and then it's FieldGetsFocus didn't work anymore. I change my problem picture to "Not in database" and its FieldGetsFocus worked, but for some reason I couldn't see the picture anymore although the new picture showed well. Changing it to "Boilerplate" solved both problems!?! Regards RogerW.  

    Thanks for info, RogerW. And that sounds about right. A Control field cannot have focus and triggers like Leave Field and Field Gets Focus are not fired. This is intended behavior. You don't want these triggers (and things like validation) being fired when you press on (e.g.) a Cancel button. In this context focus might be a bit confusing, because from a GUI point of view the "focus" is on the Control field after the user clicked on it, but for Uniface the "focus" (or prompt) is still on the previously active field. I hope this makes sense. So for your scenario a Boilerplate seems to be the best option. Regards, Daniel


    Author: diseli (daniel.iseli@uniface.com)