Windows, pressKeys, JavaScript
Posted: Wed Jun 14, 2017 2:49 pm
I will do my best to describe the issue I am facing. I currently have a screen where a user will click on a magnifying glass where on the green screen was an F4 to prompt the field. I have the javascript working to pull up that window (window on the green screen), then the user clicks on their selection and I have the javascript working to put the value in the text box and press enter for the user.
Now here is where my issue really starts, in order for the change to actually take place on the screen the user needs to press the enter key again to "update". The enter key does not need to be pressed if there are no changes. Since the window changes the element and presses enter, the value on the main page will appear to never change according to the javascript because it is already changed before page is loaded and the javascript ran. I cannot have the enter key pressed on page load of course because it loops and just keeps pressing enter disabling all functionality of the screen. I also have not figured a way to store the previous values of the element and compare that with the changed elements since the previous element will always be replaced with the changed value and therefore changing the "previous value" in the javascript before it has a chance to evaluate the true previous value. In other words the values would always match.
Is there a way to identify when a window closes so that I can capture that action on the main screen, and then apply a javascript action to press the enter key.
Now here is where my issue really starts, in order for the change to actually take place on the screen the user needs to press the enter key again to "update". The enter key does not need to be pressed if there are no changes. Since the window changes the element and presses enter, the value on the main page will appear to never change according to the javascript because it is already changed before page is loaded and the javascript ran. I cannot have the enter key pressed on page load of course because it loops and just keeps pressing enter disabling all functionality of the screen. I also have not figured a way to store the previous values of the element and compare that with the changed elements since the previous element will always be replaced with the changed value and therefore changing the "previous value" in the javascript before it has a chance to evaluate the true previous value. In other words the values would always match.
Is there a way to identify when a window closes so that I can capture that action on the main screen, and then apply a javascript action to press the enter key.