[opencms-dev] opencms-dev Digest, Vol 287, Issue 1

Clement Wee clement at elixirtech.com
Tue May 2 17:37:49 CEST 2017


Hi guys,

I am using OpenCMS 10.5.1 and having trouble with cms.enableReload. Despite
the fact that it is injected into my resource type, I don't see the
resource-type appearing. The script works when run standalone outside of
OpenCMS.

<%@page buffer="none" session="false" trimDirectiveWhitespaces="true"%>
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="elx" uri="/WEB-INF/taglib/elixir.tld"%>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>

<cms:formatter var="content" val="chart">
<jsp:useBean id="db" class="com.elixirtech.opencms.DBConfig" />

<sql:setDataSource var="spv2" driver="${db.driver}"
      url="${db.url}"
      user="${db.user}"  password="${db.password}"/>

<sql:query dataSource="${spv2}" var="prices">
${db.query}
</sql:query>
<c:set var="options" value="..."/>
<c:set var="data" value="..."/>

<div class="margin-bottom-30">
<c:set var="svg" value="img-${cms.element.id}"/>
<c:if test="${cms.edited}">
        <!-- enforce an automatic reload, when the content is edited or
moved to another container -->
        ${cms.enableReload}
</c:if>
<div id="${svg}"></div>
<script>
...
</script>
</div>
</cms:formatter>

When I insert the content, the screen flashes and then the content
disappears. Do I need to do anything additional to make sure the content
shows?

Regards,
Clement Wee
Singapore
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20170502/31044697/attachment.htm>


More information about the opencms-dev mailing list