Keyboard PagUp/PagDn with textArea widget

Use this board for starting discussions, asking questions, and giving advice on RPG programming for the IBM i platform (and predecessors.)
mjavier
New User
Posts: 17
Joined: Mon Feb 01, 2016 3:42 pm
First Name: Mario
Last Name: Javier
Company Name: Trimble
Phone: 440-721-2890
Address 1: 6350 Quadrangle Dr.
Address 2: Suite 300
City: Chapel Hill
State / Province: North Carolina
Zip / Postal Code: 27517
Country: United States
Contact:

Keyboard PagUp/PagDn with textArea widget

Post by mjavier »

I am using a "textArea" widget to display and edit notes with one of our application and have set the "overflow y" property to "visible". I can scroll up and down with the wheel on the mouse and also by clicking the scroll area above or under the position indicator.

However, the "PagUp/PagDn" on the keyboard does not work using this widget. Is there a way to enable the keyboard PagUp/PagDn keys for this widget? Is there a property that I am not seeing?

Just a note: I noticed that the background (shaded, not in focus) grid does the page up and down with the keyboard keys which is an entirely different program (see attachment).

Any help is appreciated. Thanks!
Keyboard PagUp/PagDn with textArea widget
Keyboard PagUp/PagDn with textArea widget
PageUpDown-textArea.jpg (118.56 KiB) Viewed 14799 times
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: Keyboard PagUp/PagDn with textArea widget

Post by Scott Klement »

You say the underlying screen is a "different program", but that's not really accurate. They are on the same web page in the same web browser. The response from the web page might be sent to a different RPG program on the server -- but, that's not the program that's running when you hit pageup/pagedown... the program that's running is your web browser, and it doesn't know that these are separate, since they are on the same web page.

As far as the widget goes... all it does is insert an HTML <textarea> tag into the page. A text area is a built-in feature of HTML (and therefore also your browser) and it is completely handled by the browser.

You could control it yourself by adding code in the various keyboard events on the widget. (onkeyup, onkeydown, onkeypress) You would need to check which key is pressed, and if its the pageup/pagedown key, you could block it (with the preventEvent() API or similar) so that it's not sent to the underlying screen.

You could also potentially write code that scrolls the text area. I must admit, this is something I've never done... but I strongly suspect there's a way to do it if you Google for it.

(Also, FWIW, Profound cannot generically insert JavaScript for all text areas to handle pageup/down because a lot of customers use text areas inside subfiles, and if we took control of pageup/down, we'd block them from being able to scroll the subfile with the keyboard.)
mjavier
New User
Posts: 17
Joined: Mon Feb 01, 2016 3:42 pm
First Name: Mario
Last Name: Javier
Company Name: Trimble
Phone: 440-721-2890
Address 1: 6350 Quadrangle Dr.
Address 2: Suite 300
City: Chapel Hill
State / Province: North Carolina
Zip / Postal Code: 27517
Country: United States
Contact:

Re: Keyboard PagUp/PagDn with textArea widget

Post by mjavier »

Thanks Scott for your explanation and suggestion.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests