Dynamically controlling cursor position

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
pshuey@dasinc.com
New User
Posts: 10
Joined: Wed Jan 15, 2014 11:53 am
First Name: Patti
Last Name: Henry-Shuey
Company Name: DAS Companies, Inc.
Contact:

Dynamically controlling cursor position

Post by pshuey@dasinc.com »

I have a screen that is set to automatically update when a field is changed. When this happens, the cursor always returns to the first input field on the screen. Is there a way to dynamically control the cursor position so it does not always go back to the first field?
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Dynamically controlling cursor position

Post by Scott Klement »

Web pages don't normally have the concept of "cursor position" in the same sense as 5250 applications. But, for compatibility, Profound UI has some features that attempt to provide something similar to the 5250 environment.

So you have two alternatives:

1) The web way, which isn't based on cursor position, but you can set focus to a particular field.

2) The Profound UI method that strives to assist with compatibility with 5250 applications.

For #1, you can simply tell the browser to set focus to a widget on the display in JavaScript. So you'd do something like getObj("TextBox1").focus() -- this moves the browser's focus to a field that has an id of 'TextBox1'. (Web ID's are case-senstive, so please match the upper/lowercase exactly.)

For #2, each widget has a property for 'cursor row' and 'cursor column'. These properties are unset by default on new widgets, but if converted from a 5250 display, the converter will automatically put the row/col from the 5250 display into these properties. In either event, you can change these properties to the appropriate row/column in the visual designer. (So, in Profound UI these fields don't control the widgets placement on the screen or anything, they are just here for compatibilty with 5250.) Then, at the screen level there are properties called 'set cursor row' and 'set cursor column' that you can bind to variables. When the dispay starts, Profound UI will find the widget that has the row/col that matches the values sent in the 'set row/col' properties, and will move focus to that widget.

Hope that makes sense... but anyway, either of these should work for controlling the cursor position.
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests