4 Replies Latest reply on Mar 22, 2007 8:51 PM by Sergey Smirnov

    DragIndicator broken in 3.0.1SNAPSHOT

    Stuart Robertson Novice

      This is running against the latest-from-cvs Seam, Facelets, and the JSF 1.2 RI, and viewed with Firefox.

      Firefox complains loudly of the following:

      "XML Parsing Error: not well-formed"

      Looking at the source of the page, the problem is this:

      //<![CDATA[
      
       var elt = $("indicator");
       elt.markers = {};
       elt.indicatorTemplates = {};
       //]]>elt.markers['accept'] = "<img alt=\"\" border=\"0\" width=\"16\" height=\"16\" src=\"/fb/a4j.res/org/richfaces/renderkit/html/images/accept.gif.seam\" />";
      elt.markers['default'] = "<img alt=\"\" border=\"0\" width=\"16\" height=\"16\" src=\"/fb/a4j.res/org/richfaces/renderkit/html/images/default.gif.seam\" />";
      elt.markers['reject'] = "<img alt=\"\" border=\"0\" width=\"16\" height=\"16\" src=\"/fb/a4j.res/org/richfaces/renderkit/html/images/reject.gif.seam\" />";
      elt.indicatorTemplates['single'] = function(element, jsParams) {
      var content = "<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" class=\"drgind_internal\" style=\"height : 100%\"><tr><td class=\"drgind_marker\">" + ((!!jsParams['marker']) ? jsParams['marker'] : "") + "</td><td class=\"drgind_text\"><div class=\"drgind_wordcut drgind_text_content\">" + ((!!jsParams['label']) ? jsParams['label'] : "") + "</div></td></tr></table><div class=\"drgind_shadow\"></div>";
       new Insertion.Top(element, content);
      };elt.indicatorTemplates['multi'] = function(element, jsParams) {
      var content = "<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" class=\"drgind_internal\" style=\"height : 100%\"><tr><td class=\"drgind_marker\">" + ((!!jsParams['marker']) ? jsParams['marker'] : "") + "</td><td class=\"drgind_text\"><div class=\"drgind_wordcut drgind_text_content\">" + ((!!jsParams['label']) ? jsParams['label'] : "") + "</div></td></tr></table><div class=\"drgind_shadow\"></div>";
       new Insertion.Top(element, content);
      };//<![CDATA[
       createDragIndicator(elt);
      
      //]]>
      


      The stuff in the middle isn't valid XHTML, and seems to be coming from Richfaces.

      Looking at Trunk in svn, the problem appears to come from htmlDragIndicator.jspx.

      <div id="#{clientId}" class="drgind_fly drgind_default drag_indicator #{component.attributes['styleClass']}" style="display: none; #{component.attributes['style']}">
       <script type="text/javascript">
       /*<![CDATA[*/
       var elt = $("#{clientId}");
       elt.markers = {};
       elt.indicatorTemplates = {};
       /*]]>*/
       <f:call name="encodeChildScripts" />
       /*<![CDATA[*/
       createDragIndicator(elt);
       /*]]>*/
       </script>
      


      This was working for me a few days ago, and I'm not sure if it was moving to JSF 1.2 or upgrading to 3.0.1SNAPSHOT - I did both since I last tried it.

      Btw, the maven build of Richfaces fails trying to reach http://snapshots.jboss.com. Is this something you guys can see locally but isn't public yet?

      Thanks,

      Stu