4 Replies Latest reply on Nov 5, 2009 6:10 PM by Nick Belaevski

    reRender failure with marquee element

    shadowcreeper Apprentice

      If I have a marquee in my page, the initial page load works fine but any reRender fails by sticking the contents of the marquee outside of it (as siblings rather than children).

      It doesn't matter whether I use a f:verbatim tag, a t:htmlTag, or a local custom tag (with or without a custom renderer). When I reRender it (or any of it's parents), the contents are all placed outside as siblings rather than children.

      If I make my custom tag call it a "div" rather than a "marquee", all works as expected (contents are children, not siblings).

      Please tell me there is a workaround. This is driving me nuts.

      Test case jsp file (the backing bean has a single property, a boolean):

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE html
       PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
      
      <%@ page contentType="text/html;charset=UTF-8" language="java" %>
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
      <%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j" %>
      <%
       // Make page expire immediately
       response.setHeader( "Expires", "Sat, 6 May 1995 12:00:00 GMT" );
       response.setHeader( "Cache-Control", "no-store, no-cache, must-revalidate" );
       response.addHeader( "Cache-Control", "post-check=0, pre-check=0" );
       response.setHeader( "Pragma", "no-cache" );
      %>
      
      <f:view>
       <html>
       <body>
       <a4j:region>
       <h:form>
       <a4j:jsFunction name="doReRenderStuff" reRender="testPanel">
       <a4j:actionparam name="renderMarquee" assignTo="#{bean.renderMarquee}"/>
       </a4j:jsFunction>
       </h:form>
       </a4j:region>
      
       <h:panelGroup id="testPanel">
       <div>
       <h:graphicImage url="/images/calendar.gif"
       rendered="#{bean.renderMarquee}"
       onclick="doReRenderStuff(false);"/>
       <h:graphicImage url="/images/calendar.gif"
       rendered="#{!(bean.renderMarquee)}"
       onclick="doReRenderStuff(true);"/>
       </div>
      
       <div style="width: 100%;">
       <h:panelGroup rendered="#{bean.renderMarquee}" style="width: 100%;">
       <div style="border: 1px solid green; width: 10px;">
       <marquee style="width: 10px;">
       <h:panelGrid columns="1" style="border: 1px solid black;">
       <h:outputText escape="false" value="Marquee Scrolling Text"/>
       </h:panelGrid>
       </marquee>
       </div>
       </h:panelGroup>
      
       <h:panelGroup rendered="#{!(bean.renderMarquee)}" style="width: 100%;">
       <div style="border: 1px solid green; width: 100%;">
       <h:outputText escape="false" value="Non Scrolling Text"/>
       </div>
       </h:panelGroup>
       </div>
       </h:panelGroup>
       </body>
       </html>
      </f:view>