Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Request to add new event 'On Enter' for control

SA-1178

Summary



In PRPC 6.2 SP1, the control behavior within a layout only provides three options:
OnClick, OnBlur, OnChange.

How can an event be configured to refresh the section and call a particular activity on press of the enter key?


Resolution



This issue is resolved through the following local change:


You can implement a hidden button.  When Enter is pressed then the action associated with the button would be performed.  This may need your needs.  The following approach can be used with a SEARCH button.  Note that your section is likely to be different.


To use the Enter key to execute a button functionality, do the following steps:

- Open the section and Save As with another name to keep all the current UI.
- In the original section:
o Remove all the layouts
o Add a new section layout with the created one
o Remove the flag Auto-generated html in the HTML tab.
o Include the following code:

<SCRIPT TYPE="text/javascript">
function checkSubmit(e)
{
if(e && e.keyCode == 13)
{
document.getElementById('thebutton').click();
}
}
</SCRIPT>

<div onKeyPress="return checkSubmit(event)">


<button type='button' id='thebutton' style="visibility:hidden" class='MacifRechercher pzhc' data-ctl data-click='[["refresh", ["otherSection","RechercherPersonne", "LancerRecherchePersonne", "&=", "", "",":event"]]]' ><div class='pzbtn-lft' ><div class='pzbtn-rgt'><div class='pzbtn-mid' data-click='...'><img class='pzbtn-i'/> Rechercher</div></div></div></button>

-------------------- auto generated html --------------

</div>

Using 'view source' of the html you can find the code of the button that you want to execute.
Then copy and include it, adding the ID be detected by the javascript function, and set the style to 'style="visibility:hidden"' so it's hidden.

 

Published January 31, 2016 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community 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.

Close Deprecation Notice
Contact us