Page 1 of 1

Dropdown box selection error with enter key

Posted: Mon Jan 25, 2016 12:54 pm
by chs
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

Re: Dropdown box selection error with enter key

Posted: Tue Jan 26, 2016 6:46 am
by dieter
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

Re: Dropdown box selection error with enter key

Posted: Wed Jan 27, 2016 11:55 am
by chs
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

Re: Dropdown box selection error with enter key

Posted: Fri Jan 29, 2016 4:26 am
by dieter
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

Re: Dropdown box selection error with enter key

Posted: Fri Jan 29, 2016 5:41 pm
by Scott Klement
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?-

Re: Dropdown box selection error with enter key

Posted: Mon Feb 08, 2016 6:34 am
by chs
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

Re: Dropdown box selection error with enter key

Posted: Mon Mar 13, 2017 2:20 pm
by jleander
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?

Re: Dropdown box selection error with enter key

Posted: Mon Mar 13, 2017 2:46 pm
by Scott Klement
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!

Re: Dropdown box selection error with enter key

Posted: Mon Mar 13, 2017 4:29 pm
by Scott Klement
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

Re: Dropdown box selection error with enter key

Posted: Mon Mar 13, 2017 4:41 pm
by jleander
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.