Support Article

Values of drop down properties are lost on click of back button

SA-32737

Summary



When a screen with drop-down values are getting loaded and user clicks on the Back button to navigate to the previous pages, the values of the drop-down are removed from the clipboard.

Error Messages



Not Applicable


Steps to Reproduce



1) Create a section with drop-down values and the Back button to navigate to the previous page.
2) During runtime click the back button before the screen can load all the drop-down values.
3) Now check the value of the drop-down fields in the clipboard, and they all appear empty.

Root Cause



An activity was being called to populate the values which takes time to get executed and the navigation buttons were enabled at all times.

So user can click the Back button before the values are loaded and this leads to empty values getting loaded in the drop-down fields which was getting reflected in the clipboard.

Hence Pega has provided a script that disables the navigation buttons until all the drop-down values are loaded.

Resolution



Add the below script into the UserWorkForm:
[code]
<style> 
#dimmer { 
background:#000; 
opacity:0.2; 
position:absolute; 
top:0; 
left:0; 
width:100%; 
height:100%; 
display:block; 
z-index:100500; 
MsFilter: progid:DXImageTransform.Microsoft.Alpha(Opacity=20); 
filter: alpha(opacity=20); 
MozOpacity: 0.2; 
KhtmlOpacity: 0.2; 

</style> 


<script> 
$(document).ready(function(){ 
if(window && window.frameElement){ 
variframeEle = window.frameElement
$(iframeEle).load(function(){ 
/*$(document).find("#HARNESS_BUTTONS button").attr("disabled", "disabled");*&nbsp;
if($(document).find("#ComplaintSubCat").length > 0){ 
if($(document).find("#HARNESS_BUTTONS").find("#dimmer").length > 0) 
$(document).find("#HARNESS_BUTTONS").find("#dimmer").hide(); 
else 
$(document).find("#HARNESS_BUTTONS").append("<div id=\"dimmer\">Loading...</div>"); 
/*$.when($.ajax(document.URL)).then(function() {*&nbsp;
setTimeout(function(){ 
$(document).find("#HARNESS_BUTTONS").find("#dimmer").hide(); 
// $(document).find("#HARNESS_BUTTONS button").removeAttr("disabled"); 
}, 9000);
/*}); *&nbsp;

}); 

}); 
</script>
 [/code]

NOTE: Pega has provided 9000 ~ 9 sec delay to enable button. User can modify the delay time according to the performance of the application. 

Published January 21, 2017 - Updated March 3, 2017

Have a question? Get answers now.

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