Support Article
Delete action does not work in repeating dynamic layout
Summary
The Delete action does not work for a repeating dynamic layout when sourced by a page group property.
Error Messages
Not Applicable.
Steps to Reproduce
- Configure a repeating dynamic layout with a page group property
- Configure a Delete action event
- Attempt to delete a record
Root Cause
Delete action does not support page group sourced repeating dynamic layouts.
Resolution
Perform the following local-change:- Include the following JavaScript function in a JS file included in the Harness or in the UserWorkForm:
<script>
function removeFromPageGroup(event) {
var pageGroupProperty = jQuery(event.target).closest('[data-repeat-source]').attr('data-repeat-source');
var rowBaseRef = pega.u.d.getBaseRef(event.target);
var lastLeftParentheses = rowBaseRef.lastIndexOf("(");
var lastRightParentheses = rowBaseRef.lastIndexOf(")");
var subscript = rowBaseRef.substring(lastLeftParentheses + 1, lastRightParentheses);var safeUrl = SafeURL_createFromURL(pega.u.d.url);
safeUrl.put("pyActivity", "@baseclass.RemoveFromPageGroup");
safeUrl.put("PageGroupProperty", pageGroupProperty);
safeUrl.put("Subscript", subscript);pega.u.d.asyncRequest("GET", safeUrl, {
'success': function() {
var sectionNode = pega.u.d.getEnclosingSection(jQuery(event.target).closest('[data-repeat-source]').get(0));
pega.u.d.reloadSection(sectionNode);
}
});
}
</script> - Change the action from 'Delete item' to 'Run script'
- Set the function name as 'removeFromPageGroup' and add a parameter with value, 'script:event'
Published August 15, 2019 - 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.