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

Single and double click events do not work in Listview

SA-7466

Summary



Single and double click events are not working in the List views rows.

Error Messages



Not Applicable. 

Steps to Reproduce



1. Create a List View.
2. Add the below code in the Footer of the List View.
a. JavaScript code to save the list view and column IDs, in the form of a custom non-auto-generated section, to be included as a footer on the list views:

<script>
var orig;

if(!orig)
orig = pega.ui.ListView.prototype.sortColumn;

pega.ui.ListView.prototype.sortColumn = function(strColumnName,strQueryTimeStamp,e){ 

var lvArr = pega.util.Dom.getElementsById("embeddedlvbody");
for(var i=0;i<lvArr.length;i++)
{
if(pega.util.Dom.isAncestor(lvArr[i].parentNode,e.srcElement))
{
lvId=lvArr[i].parentNode.id;
}
}

var cName = e.srcElement.className;
if(cName=="lv_header_span")
{
var par = e.srcElement.parentNode;
indexVal = par.colIndex;
}

if(cName=="lv_header_col")
{
indexVal=e.srcElement.colIndex;

}

if(cName=="rplistarrowup")
{
var par = e.srcElement.parentNode.parentNode.parentNode;
indexVal=par.colIndex;
}

if(e.srcElement.tagName=='A')
{
var par = e.srcElement.parentNode.parentNode;
indexVal=par.colIndex;

}

orig.call(this,strColumnName,strQueryTimeStamp,e);
setTimeout("setFocus()",500);

}



</script>
<script>
function setFocus()
{


var arr = pega.util.Dom.getElementsByClassName("lv_header_span","span",lvId);
for(var j=0;j<arr.length;j++)
{
if(arr[j].parentNode.colIndex==indexVal)
{

arr[j].focus();

break;
}

}

}

</script>



b. JavaScript code to declare the ID variables in the UserWorkForm HTML entry point:

<script>
var indexVal = -1;
var lvId="";
 
</script>

3. Have a single click configured on the list view and sorting enabled.
4. Run the List View and check the single click on row.
5. Sort the List View and check the single click on row once again.


Root Cause



The error is because of the custom script added at the footer of the list view. The script is used to retain focus on the column after sorting.

Resolution



Removed the script resolves the issue. The script no longer functions well in Pega 7.x. The functionality of retaining the focus was required and hence Enhancement request FDBK-10620 was raised to address the issue.
Suggest Edit

Published January 31, 2016 - Updated October 8, 2020

Did you find this content helpful? Yes No

Have a question? Get answers now.

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

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