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

JavaScript error on using grid inside tabbed repeat layout



Referring to a repeat grid with details shown using the "embedded elsewhere-In place of a section" option in a tabbed layout prevents user from adding multiple tabs. Once a new tab is added, the screen freezes. On click of a new tab a javascript error is displayed.

Error Messages

Uncaught TypeError: Cannot read property 'id' of null
pega.ui.initGrids @ pzpega_ui_grid_1394839166.js!pzpega_ui_grid_dragdrop_13547640236.js!pega_yui_resize_1754469339.js!!.js:1docLifecycle.initializeGrids @ pega_ui_harness_11180311311!!.js:7docLifecycle.processOnloads @ pega_ui_harness_11180311311!!.js:7ajaxengine.loadHTMLEleCallback @ pega_ui_harness_deferred_13126745870!! @ pega_ui_harness_deferred_13126745870!! @ pega_ui_harness_deferred_13126745870!! @ pega_ui_harness_deferred_13126745870!!.js:1587ajaxengine.loadDOMObject @ pega_ui_harness_deferred_13126745870!!.js:1ajaxengine.handleSuccess @ pega_ui_harness_deferred_13126745870!!.js:1ajaxengine.handleReloadRepeatSuccess @ pega_ui_harness_deferred_13126745870!!.js:1H.success @ pega_ui_harness_deferred_13126745870!!.js:1pega.util.Connect.handleTransactionResponse @ pega_desktop_domainsuffix_1819019784.js!clientlogbase_11632504602.js!pega_y…2!developerwrapperapi_12187829019.js!pzautomationscripts_1854328436!!.js:6(anonymous function) @ pega_desktop_domainsuffix_1819019784.js!clientlogbase_11632504602.js!pega_y…2!developerwrapperapi_12187829019.js!pzautomationscripts_1854328436!!.js:6

Steps to Reproduce

Add a new tab to a proposal work object to observe the issue.


This issue is resolved by HFix-22589 for Pega 7.1.8. This can also be addressed by adding the below code in UserWorkForm. This change would need to be removed before upgrading to Pega 7.1.9.

function gridFix(){
                if(pega && pega.u){
                                pega.u.initGrids = function(grid) {
                                                                window.printWin = true;
                                                                var gridarray=;
                                                                for(var instance in gridarray) {
                                                                                var gridEle = document.getElementById(instance);
                                                                                                Grids.addGrid( , new pega.ui.grid(gridEle));
                                                if(grid && typeof grid!="undefined") {
                                                                var gridElements = pega.util.Dom.getElementsById("PEGA_GRID",grid.gridDiv);
                                                else {
                                                                var gridElements = pega.util.Dom.getElementsById("PEGA_GRID");
                                                if(!gridElements) {
                                                var len = gridElements.length;
                                                var gridEle = null;
                                                var iAttribute = "";
                                                for(var i = 0; i < len; i++) {
                                                                /* add index to the id's so that these grids don't get reinitialized when some other section is refreshed */
                                                                gridEle = gridElements[i];
                                                                var newGridId = + pega.ui.gridCounter;
                                                       = newGridId;
                                                                var gridObj = new pega.ui.grid(gridEle);
                                                                Grids.addGrid(newGridId , gridObj);
                                                                /*BUG-83172 START: If grid is present in tab, register a listener onTabActive to call onTabActiveFixGrid */
                                                                if(pega.u.d.tabViewMap) {
                                                                                var temp = gridEle.parentNode;
                                                                                while(!temp.getAttribute("tabgroupid")) {
                                                                                                temp = temp.parentNode;
                                                                                                if(!temp || == "HARNESS_CONTENT" || temp.nodeName.toUpperCase() == "BODY") { // for tabs || for panelset
                                                                                                                temp = null;
                                                                                if(temp) {
                                                                                                var tabgrp = pega.u.d.tabViewMap[];
                                                                                                if(tabgrp) {
                                                                                                                var activeTab = tabgrp._configs.tabs.value[tabgrp.get("activeIndex")];
                                                                                                                var activeTabContent = activeTab._configs.contentEl.value;
                                                                                                                if(!pega.util.Dom.isAncestor(activeTabContent, gridObj.gridDiv)) {
                                                                                                                                tabgrp.on("activeTabChange", gridObj.onTabActiveFixGrid, null, gridObj);
                                                                /*BUG-83172 END */
                pega.u.d.attachOnload(gridFix, true);

Published June 23, 2015 - 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