Question
Pega data-onchange and data-keydown issue
Hey all I am at a loss as to how to go about firing this data-change and data-keydown of this element:
<input data-test-id="20180656816"
data-ctl="["TextInput"]"
id="L_ID"
maxlength="15"
validationtype="required"
value=""
name="$PpyWorkPage$pL$pL_ID"
class="leftJustifyStyle"
data-change="[["postValue",[":event"]],["refresh", ["otherSection","RecordInformation", "", "&=", "", "LIDOnChange,",":event","","pyWorkPage.L"]]]"
data-keydown="[["postValue",[":event"],,"tab"],["refresh", ["otherSection","RecordInformation", "", "&=", "", "LIDOnChange,",":event","","pyWorkPage.L"],,"tab"],["postValue", [":event"],,"enter"],["refresh", ["otherSection","RecordInformation","", "&=", "", "LIDOnChange,",":event","","pyWorkPage.L"],, "enter"]]"
data-changed="false"
style="background-color: rgb(255, 255, 255);"
type="text">
When I am using IBM RFT (WebUI) I input the letters (via RFT) into this textfield (L_ID) and it does not seem to trigger the data-change and/or data-keydown.
It seems that sending keys to the browsers' text field never registers as if a human was typing it on a keyboard. In other words it treats it as no letters were typed and therefore nether data attributes were fired off. Tabs, clicks, focus(), blur() seem not to have any effect on the text field via jQuery.
Doing this manually - clicking the textfield with the mouse, entering some letters and either tab out or click on another textfield makes it work as it should - but that doesn't help me in this regards as I need to have it automate.
Is there any way to populate that L_ID so that it populates a label next to it (which is what happens when it does do the data-onchange and data-keydown actions.
***Edited by Moderator: Pallavi to update platform capability tags***
I believe underneath the hood event listeners are used to drive this. So if the equivalent browser/keyboard events are not generated using your automated test suite, then it would explain why it is not firing.
You could probably test this outside of Pega with some keyboard event listeners and seeing if they trigger there. If you want to take this one step at a time, you could start with built-in JS events like onBlur onChange, etc and see if that works. Then graduate into making your own custom listener and seeing if that works. Because if this standalone test fails, then you may want to consult the vendor/documentation for this test suite to understand how to generate equivalent events.
Or if you find out, this only fails inside of Pega, we may need to dig a bit further.