Support Article
Change event does not work correctly with pxRadioButton
SA-50572
Summary
Change event does not work correctly with pxRadioButton.
On configuring a change event on the pxRadioButton control with a refresh section action, it reloads and invokes an activity every time the radio button is clicked. However, the value does not change.
Error Messages
Not Applicable
Steps to Reproduce
- Configure a pxRadioButton with an OnChange event to refresh the section calling an activity.
- Click the same value or radio button. The activity is invoked and the section is refreshed each time.
Root Cause
Until Pega 7.2.1, data click was generated even for change actions. However, from Pega 7.2.2, data change is generated for change events.
Resolution
Perform the following local-change in the section with a radio group:
Configure a non-autogenerated section and add the below script.
<script>
$(document).ready(function(){
$(".radioTable").click(function(){
var eventEle = pega.util.Event.getTarget(event);
var tabElem = eventEle.parentNode.parentNode.parentNode; if(eventEle.tagName=="LABEL"){
if($(eventEle).siblings("input").prop("checked")){
event.cancelBehavior = true;
event.stopPropagation();
}
}
});
});
</script>
Published September 8, 2018 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.