Hi All,
Preview mode doesn't function properly on clicking the preview option, but working fine if we refresh the page. Could anyone help me to resolve this issue ? Is it a known bug ?
Thanks in advance!
Solved! Go to Solution.
Views
Replies
Total Likes
Hi
Please have a look at this article, this seems like your problem too.
//preview mode in sidekick does not refresh automatically
The solution is simply to force a page refresh automatically when switching to preview mode.
CQ.WCM.launchSidekick("<%= currentPage.getPath() %>", { propsDialog: "<%= dlgPath == null ? "" : dlgPath %>", locked: <%= currentPage.isLocked() %>,previewReload: "true"});
Workaround :- https://helpx.adobe.com/experience-manager/kb/LinkToPreviewMode.html
Please check the browser console errors and error.log to better debug this problem.
Thanks and Regards
Kautuk Sahni
Views
Replies
Total Likes
Have you changed anything in init.jsp file?
Which AEM version you are using?
Views
Replies
Total Likes
see if there is any JS error when you change to preview mode
Views
Replies
Total Likes
Hi
Please have a look at this article, this seems like your problem too.
//preview mode in sidekick does not refresh automatically
The solution is simply to force a page refresh automatically when switching to preview mode.
CQ.WCM.launchSidekick("<%= currentPage.getPath() %>", { propsDialog: "<%= dlgPath == null ? "" : dlgPath %>", locked: <%= currentPage.isLocked() %>,previewReload: "true"});
Workaround :- https://helpx.adobe.com/experience-manager/kb/LinkToPreviewMode.html
Please check the browser console errors and error.log to better debug this problem.
Thanks and Regards
Kautuk Sahni
Views
Replies
Total Likes
Hi Kautuk,
I have tried adding previewReload:"true", but didn't work, the sidekick disappeared post adding it. Also, couldn't find any js errors on the browser console. Please let me know if there is any other way.
Regards,
Prabodh
Views
Replies
Total Likes
No, I haven't changed anything in init.jsp. Using AEM 6.1.
Views
Replies
Total Likes
Are you seeing this with all projects?
Can you share init.jsp u are using?
Views
Replies
Total Likes
We have only one project, but also seeing the same behavior in Geometrix project.
init.jsp:
<%@page session="false"%><%--
Copyright 1997-2010 Day Management AG
Barfuesserplatz 6, 4001 Basel, Switzerland
All Rights Reserved.
This software is the confidential and proprietary information of
Day Management AG, ("Confidential Information"). You shall not
disclose such Confidential Information and shall use it only in
accordance with the terms of the license agreement you entered into
with Day.
==============================================================================
Default init script.
Draws the WCM initialization code. This is usually called by the head.jsp
of the page. If the WCM is disabled, no output is written.
==============================================================================
--%><%@include file="/libs/foundation/global.jsp" %><%
%><%@page import="com.day.cq.wcm.api.AuthoringUIMode,
com.day.cq.wcm.api.WCMMode" %><%
%><%
if (WCMMode.fromRequest(request) != WCMMode.DISABLED) {
String dlgPath = null;
if (editContext != null && editContext.getComponent() != null) {
dlgPath = editContext.getComponent().getDialogPath();
}
AuthoringUIMode authoringUIMode = AuthoringUIMode.fromRequest(slingRequest);
if (authoringUIMode != null && authoringUIMode != AuthoringUIMode.CLASSIC) {
%><cq:includeClientLib categories="cq.authoring.page" /><%
} else {
%><cq:includeClientLib categories="cq.wcm.edit" />
<script type="text/javascript">
(function() {
var cfg = <%
try {
sling.getService(com.day.cq.wcm.undo.UndoConfigService.class)
.writeClientConfig(out);
} catch (Exception e) {
// ignore
}
%>;
<%-- explicitly set page path, as under some circumstances, CQ.WCM.getPagePath() --%>
<%-- may yield unwanted results at this point --%>
cfg.pagePath = "<%= xssAPI.encodeForJSString(currentPage.getPath()) %>";
if (CQClientLibraryManager.channelCB() != "touch") {
var isEditMode = <%= WCMMode.fromRequest(request) == WCMMode.EDIT ? "true" : "false" %>;
if (!isEditMode) {
cfg.enabled = false;
}
CQ.undo.UndoManager.initialize(cfg);
CQ.Ext.onReady(function() {
CQ.undo.UndoManager.detectCachedPage(<%= System.currentTimeMillis() %>);
});
}
})();
CQ.WCM.launchSidekick("<%= xssAPI.encodeForJSString(currentPage.getPath()) %>", {
propsDialog: "<%= dlgPath == null ? "" : xssAPI.encodeForJSString(dlgPath) %>",
locked: <%= currentPage.isLocked() %>
});
</script>
<%
}
}
%>
Views
Replies
Total Likes
Views
Likes
Replies