Closed
Refresh section on Backspace key action
We have a requirement to refresh the section on the backspace keyboard key. Can somebody help me how it implement it? Thanks in advance.
This content is closed to future replies and is no longer being maintained or updated.
Links may no longer function. If you have a similar request, please write a new post.
We have a requirement to refresh the section on the backspace keyboard key. Can somebody help me how it implement it? Thanks in advance.
You could create some custom JS here to add an event listener for keydown events, then check if it was for a backspace. Once you fall into that block you could call reloadsection.
Hi,
I tried the following steps (might be a little elaborate):
> For any control in the section add a keyboard event - any key and use a Run Script action. This script can be included in UserWorkForm.
> In the script, check if event.keyCode = 8 (this is the key code for backspace button). If true, call the OOTB ReloadSection activity.
Do check this link for some additional info: https://css-tricks.com/snippets/javascript/javascript-keycodes/
Hope this helps.
Thanks
Hi ,
Could you confirm on the requirement,
1.Through out the application , when you click on backspace do you want the section to be refreshed or
2.is it specific to any control like on a link or on a button when you click on backspace you want it to be refreshed.
For first approach , either in userWorkForm or in harnesslevel js , custom script needs to be included as below
<script>
document.addEventListener("keydown", checkbackSpace);
function checkbackSpace(event){
if (event.keyCode == 8) {
alert("in the function");
pega.u.d.refreshSection("SectionName");
}
}
</script>
For the second case you can write a runscript action as shown below ,pass javascript:event as value and use the same function ,place the below code in userWorkForm.
Hi ,
Could you confirm on the requirement,
1.Through out the application , when you click on backspace do you want the section to be refreshed or
2.is it specific to any control like on a link or on a button when you click on backspace you want it to be refreshed.
For first approach , either in userWorkForm or in harnesslevel js , custom script needs to be included as below
<script>
document.addEventListener("keydown", checkbackSpace);
function checkbackSpace(event){
if (event.keyCode == 8) {
alert("in the function");
pega.u.d.refreshSection("SectionName");
}
}
</script>
For the second case you can write a runscript action as shown below ,pass javascript:event as value and use the same function ,place the below code in userWorkForm.
<script>
function checkbackSpace(event){
if (event.keyCode == 8) {
alert("in the function");
pega.u.d.refreshSection("SectionName");
}
}
</script>
Thank you Bhavana, it should work. thank you!
Question Solved
Question Solved
Question
Question Solved
Question
Question
Discussion
Question Solved
Question
Question Solved
Pega Collaboration Center has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.