Unable to select the components on a page

独自空忆成欢 提交于 2019-12-02 17:50:52

问题


I want to perform a rollout only for the selected components in the page. I noticed that I am not able to select any of the components presented in the pages using the small checkbox in the component's edit bar.

I am not sure why this is happening. All of them are custom components and not OOTB ones.

Any solutions to this, please share them.


回答1:


I just discovered that in EditBar.js, the listener associated with the checkbox was not functioning. The following loc can be found at /libs/cq/ui/widgets/source/widgets/wcm/EditBar.js if not overlayed.

listeners: {
            check: function(cb, checked) {
                if (checked) {
                    CQ.WCM.select(editBar, true);
                } else {
                    CQ.WCM.deselect(editBar, true);
                }
            }
        }

It worked when the 'check' event was changed to 'selectionChanged' . Clearing the browser cache, reload the page to see the changes. Thanks!




回答2:


There is no selectionChanged event, so it doesn't work correctly when e.g. rollout is used, it should be changed to:

listeners: {
    check: function(cb, checked) {
        if (checked) {
            CQ.WCM.select(editBar, true, true);
        } else {
            CQ.WCM.deselect(editBar, true, true);
        }
    }
}


来源:https://stackoverflow.com/questions/30317413/unable-to-select-the-components-on-a-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!