[opencms-dev] ${cms.enableReload} erases elements

Clement Wee clement at elixirtech.com
Mon Mar 6 04:27:00 CET 2017


Dear OpenCMS Admin,

I created a custom module that contains javascript. Following advice from a
recent post on this mailing list, I included the ${cms.enableReload}
command so that the script result refreshes on every edit.

However, now when I drag the component over my template, the whole page
refreshes and then the component disappears along with any other component
added prior to adding that component.

My template is a custom template with navigation.

Here is the template in entirety:-

<%@page buffer="none" session="false" trimDirectiveWhitespaces="true" %>
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<cms:headincludes type="css" />
  <cms:headincludes type="javascript" />
<cms:enable-ade />
</head>
<body>
<cms:include
file="%(link.weak:/system/modules/com.elixirtech.opencms/elements/main-nav.jsp:169a79fe-ff14-11e6-ba85-a75a6890411c)"/>
<cms:container name="elx-main-content" type="element" width="500"
maxElements="8" detailview="true"/>
</body>
</html>

The include is:-

<%@page taglibs="c,cms" %>
<c:set var="navStartLevel">1</c:set>
<cms:navigation type="treeForFolder" startLevel="${navStartLevel}"
endLevel="4" var="nav"/>
<ul class="nav-side list-group sidebar-nav-v1">
<c:forEach items="${nav.items}" var="elem">
<li class='nav-side-level-${elem.navTreeLevel - navStartLevel}
          list-group-item
          ${!elem.navigationLevel &&
nav.isActive[elem.resourceName]?"active":""}'>
<a href="<cms:link>${elem.resourceName}</cms:link>">${elem.navText}</a>
</li>
</c:forEach>
</ul>

as gotten directly from the tutorial.

Could someone please explain why the vanishing act occurs?


Regards,
Clement
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20170306/2fe688ec/attachment.htm>


More information about the opencms-dev mailing list