Dropdown box selection error with enter key
-
- Profound User
- Posts: 53
- Joined: Tue Jan 27, 2015 8:13 am
- First Name: Christoph
- Last Name: Seitz
- Company Name: Waser + Co. AG
- Phone: +41 44 94 74 341
- Address 1: Erlenwiesenstrasse 2
- City: Volketswil
- State / Province: Outside Canada/USA
- Zip / Postal Code: 8604
- Country: Switzerland
- Contact:
Dropdown box selection error with enter key
Hi,
We have a dropdown box filled with several values and use a pui.click() code on the onchange event of the dropdown box.
If we select a value with the mouse, everything works fine.
If we click on the dropdown box with the left mouse button (the dropdown values are shown) and press the arrow down or up key to select another value and then press the enter key, the selected value is not present in the rpg program. Instead, the previously selected value is present.
How can we solve this issue or can you fix this issue ?
Thank you very much for your answer in advance.
Christoph
We have a dropdown box filled with several values and use a pui.click() code on the onchange event of the dropdown box.
If we select a value with the mouse, everything works fine.
If we click on the dropdown box with the left mouse button (the dropdown values are shown) and press the arrow down or up key to select another value and then press the enter key, the selected value is not present in the rpg program. Instead, the previously selected value is present.
How can we solve this issue or can you fix this issue ?
Thank you very much for your answer in advance.
Christoph
-
- Experienced User
- Posts: 122
- Joined: Tue May 22, 2012 6:45 am
- First Name: Dieter
- Last Name: Schröder
- Company Name: Ecclesia Holding GmbH
- State / Province: Outside Canada/USA
- Country: Germany
- Contact:
Re: Dropdown box selection error with enter key
Strange,
in our application this works. We also have an pui.click() on the onChange event. If i use the arrow keys to navigate between the choices, it works. If i click on the down arrow and then select a choice with the arrow keys, it also works. We are on version 5.2.0.
Dieter
in our application this works. We also have an pui.click() on the onChange event. If i use the arrow keys to navigate between the choices, it works. If i click on the down arrow and then select a choice with the arrow keys, it also works. We are on version 5.2.0.
Dieter
-
- Profound User
- Posts: 53
- Joined: Tue Jan 27, 2015 8:13 am
- First Name: Christoph
- Last Name: Seitz
- Company Name: Waser + Co. AG
- Phone: +41 44 94 74 341
- Address 1: Erlenwiesenstrasse 2
- City: Volketswil
- State / Province: Outside Canada/USA
- Zip / Postal Code: 8604
- Country: Switzerland
- Contact:
Re: Dropdown box selection error with enter key
Hi Dieter,
Thanks for your response.
We also use Profound version 5.2.0 and Internet Explorer 11. Which browser do you use?
We did a test with Google Chrome 47.0.2526.111.M and it worked as well. It seems to be an Internet Explorer issue.
We also could solve the Internet Explorer 11 issue using the following Java Script code:
Onkeydown Event:
var key = event.keyCode;
if (key == 13) {
preventEvent(event);
pui.focusOnContainer();
}
A fix for this Internet Explorer 11 problem (without having to code additional Java Script code everytime we use a dropdown box) would be appreciated.
Christoph
Thanks for your response.
We also use Profound version 5.2.0 and Internet Explorer 11. Which browser do you use?
We did a test with Google Chrome 47.0.2526.111.M and it worked as well. It seems to be an Internet Explorer issue.
We also could solve the Internet Explorer 11 issue using the following Java Script code:
Onkeydown Event:
var key = event.keyCode;
if (key == 13) {
preventEvent(event);
pui.focusOnContainer();
}
A fix for this Internet Explorer 11 problem (without having to code additional Java Script code everytime we use a dropdown box) would be appreciated.
Christoph
-
- Experienced User
- Posts: 122
- Joined: Tue May 22, 2012 6:45 am
- First Name: Dieter
- Last Name: Schröder
- Company Name: Ecclesia Holding GmbH
- State / Province: Outside Canada/USA
- Country: Germany
- Contact:
Re: Dropdown box selection error with enter key
Hello Christoph,
we declared Chrome to be the standard browser in our company. There are some differences in the rendering of the browsers. So we decided that Google Chrome is the only browser, which is supported by us. Our applications are tested with Chrome only. We only have internal users, so we can define the browser.
Dieter
we declared Chrome to be the standard browser in our company. There are some differences in the rendering of the browsers. So we decided that Google Chrome is the only browser, which is supported by us. Our applications are tested with Chrome only. We only have internal users, so we can define the browser.
Dieter
-
- 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: Dropdown box selection error with enter key
Hi Christoph,
I'm trying to understand what the problem here actually is. In your solution, you've written code that checks if the enter key is pressed, and if so, blocks the keypress (preventEvent) so that it's not propagated. Wouldn't that also stop the 'onchange' event from firing? You are also moving the focus off of of the widget, and putting it onto an off-screen hidden widget. (That's what pui.focusOnContainer() does. Originally it would put focus on the container element, but that was changed awhile back because it didn't work well, so now this routine puts focus into an off-screen element, and it's name is no longer accurate!)
I'm trying to understand how that solves the problem you describe. I guess maybe I need to try to reproduce your problem so that I'll understand...?
Maybe you could provide a Ctrl-F9 JSON dump for this to make it easy for us to reproduce?-
I'm trying to understand what the problem here actually is. In your solution, you've written code that checks if the enter key is pressed, and if so, blocks the keypress (preventEvent) so that it's not propagated. Wouldn't that also stop the 'onchange' event from firing? You are also moving the focus off of of the widget, and putting it onto an off-screen hidden widget. (That's what pui.focusOnContainer() does. Originally it would put focus on the container element, but that was changed awhile back because it didn't work well, so now this routine puts focus into an off-screen element, and it's name is no longer accurate!)
I'm trying to understand how that solves the problem you describe. I guess maybe I need to try to reproduce your problem so that I'll understand...?
Maybe you could provide a Ctrl-F9 JSON dump for this to make it easy for us to reproduce?-
-
- Profound User
- Posts: 53
- Joined: Tue Jan 27, 2015 8:13 am
- First Name: Christoph
- Last Name: Seitz
- Company Name: Waser + Co. AG
- Phone: +41 44 94 74 341
- Address 1: Erlenwiesenstrasse 2
- City: Volketswil
- State / Province: Outside Canada/USA
- Zip / Postal Code: 8604
- Country: Switzerland
- Contact:
Re: Dropdown box selection error with enter key
Hi Scott,
Attached, I send you a JSON dump and some screen shots to reproduce the issue mentioned on January 25th.
While using the profound sample with IE11, we experienced the same issue (see attached file Profound Sample).
Thank you for your help in advance.
Christoph
Attached, I send you a JSON dump and some screen shots to reproduce the issue mentioned on January 25th.
While using the profound sample with IE11, we experienced the same issue (see attached file Profound Sample).
Thank you for your help in advance.
Christoph
- Attachments
-
- Profound Sample.docx
- (19.24 KiB) Downloaded 245 times
-
- DropDownBoxError - Screen shots.docx
- (323.52 KiB) Downloaded 792 times
-
- DropDownBoxError - JSON Screen Dump.txt
- (31.16 KiB) Downloaded 252 times
-
- New User
- Posts: 6
- Joined: Tue Apr 05, 2016 3:19 pm
- First Name: James
- Last Name: Leander
- Company Name: Victaulic
- Contact:
Re: Dropdown box selection error with enter key
I am also seeing this behavior when using Enter in a dropdown defined as a select box, and would like to avoid adding the js code Christoph provided if possible. Did anything ever come out of the screen dump that was provided?
-
- 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: Dropdown box selection error with enter key
Forums are provided in hopes of creating a sense of "community". Various customers can talk to each other, share ideas, tips, etc. And we (staff) also join in and give our thoughts... it is NOT the place to report bugs, because there's nothing to track what happens here.
So... your question "Did anything ever come out of the screen dump that was provided?" -- I have no clue. No way to look back and see what happened, etc.
If this is at all important to you, please report it to Profound Logic!
So... your question "Did anything ever come out of the screen dump that was provided?" -- I have no clue. No way to look back and see what happened, etc.
If this is at all important to you, please report it to Profound Logic!
-
- 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: Dropdown box selection error with enter key
I took a quick look at Christoph's screen dump. What is happening is that Internet Explorer is submitting the screen back to IBM i when you press enter. The default behavior in Profound UI is to submit the screen when you press enter unless the "disable enter key" (screen-level) property is enabled. Other browsers do not propagate the Enter keypress up to the screen when you have the drop-down open, instead they just close the drop down. But, for reasons I don't understand, Internet Explorer sends the Enter keypress to the screen-level rather than closing the dropdown.
If you enable the "disable enter key" screen-level property, it should prevent this.
The JavaScript code that Christoph provided stops the problem by blocking the Enter key so that it is not propagated.
Again, if you want Profound Logic to do anything about this (other than take a "quick look") please report it as a bug so that our team will look into it. Bugs are reported either by e-mailing support@profoundlogic.com or by web http://www.profoundlogic.com/contact?type=support
If you enable the "disable enter key" screen-level property, it should prevent this.
The JavaScript code that Christoph provided stops the problem by blocking the Enter key so that it is not propagated.
Again, if you want Profound Logic to do anything about this (other than take a "quick look") please report it as a bug so that our team will look into it. Bugs are reported either by e-mailing support@profoundlogic.com or by web http://www.profoundlogic.com/contact?type=support
-
- New User
- Posts: 6
- Joined: Tue Apr 05, 2016 3:19 pm
- First Name: James
- Last Name: Leander
- Company Name: Victaulic
- Contact:
Re: Dropdown box selection error with enter key
I had already opened a ticket per your first reply but I believe the property you pointed out should let me get my screen working for now. Thank you for following up so quickly.
Who is online
Users browsing this forum: No registered users and 1 guest