"Not well formed" issue when speicfying a drag indicator
vitanov Jan 10, 2008 8:01 PMHello guys,
So this is my issue:
I'm developing a masters diploma project that has to be ready by 23.01. Now because I am developing this since the summer, I started with richfaces 3.0.1. My current configuration is:
JSF Sun RI 1.2
Tomahawk 1.1.6
Facelets 1.1.14
Tomcat 5.5.23
All running on Java 5 update 12
So, I decided to migrate to richfaces 3.1.3 because of the contextMenu support and I also need the "nothingLabel" option added to the rich:suggestionbox.
After I migrated (changed the web.xml, removed the a4j jars and filter, added the richfaces filter) now I have a unsolveable issue - if I have a rich:dragIndicator on a page, the page is not rendered and FF says - "XML Parsing Error: not well-formed". The thing it does't like is:
elt.indicatorTemplates = {};elt.markers['accept'] = "<img alt=\"\" border=\"0\" width=\"16\" height=\"16\" src=\"/a4j_3_2_0-SNAPSHOTorg/richfaces/renderkit/html/images/accept.gif.jsf\" />"
I opened the image mentioned in the link - it's the image for acceptance of dragged objects. So then I opened the page containing the richfaces examples and viewed the source. There IS a difference. That is my not-well formed page source:
<div class="drgind_fly drgind_default drag_indicator " id="indicator" style="display: none; " xmlns:rich="http://richfaces.ajax4jsf.org/rich"> <script type="text/javascript">var elt = $("indicator"); elt.markers = {}; elt.indicatorTemplates = {};elt.markers['accept'] = "<img alt=\"\" border=\"0\" width=\"16\" height=\"16\" src=\"/a4j_3_2_0-SNAPSHOTorg/richfaces/renderkit/html/images/accept.gif.jsf\" />"; elt.markers['default'] = "<img alt=\"\" border=\"0\" width=\"16\" height=\"16\" src=\"/a4j_3_2_0-SNAPSHOTorg/richfaces/renderkit/html/images/default.gif.jsf\" />"; elt.markers['reject'] = "<img alt=\"\" border=\"0\" width=\"16\" height=\"16\" src=\"/a4j_3_2_0-SNAPSHOTorg/richfaces/renderkit/html/images/reject.gif.jsf\" />"; elt.indicatorTemplates['single'] = DefaultDragIndicatorView;elt.indicatorTemplates['multi'] = DefaultDragIndicatorView;createDragIndicator(elt, '', '');</script></div>
And this is the source on the richfaces demo page:
<div class="drgind_fly drgind_default drag_indicator " id="indicator" style="display: none; " xmlns:rich="http://richfaces.ajax4jsf.org/rich"><script type="text/javascript"> //<![CDATA[ var elt = $("indicator"); elt.markers = {}; elt.indicatorTemplates = {};elt.markers['accept'] = "<img alt=\"\" border=\"0\" width=\"16\" height=\"16\" src=\"/richfaces-demo/a4j_3_1_3.GAorg/richfaces/renderkit/html/images/accept.gif.jsf\" />"; elt.markers['default'] = "<img alt=\"\" border=\"0\" width=\"16\" height=\"16\" src=\"/richfaces-demo/a4j_3_1_3.GAorg/richfaces/renderkit/html/images/default.gif.jsf\" />"; elt.markers['reject'] = "<img alt=\"\" border=\"0\" width=\"16\" height=\"16\" src=\"/richfaces-demo/a4j_3_1_3.GAorg/richfaces/renderkit/html/images/reject.gif.jsf\" />"; elt.indicatorTemplates['single'] = DefaultDragIndicatorView;elt.indicatorTemplates['multi'] = DefaultDragIndicatorView;createDragIndicator(elt, '', ''); //]]> </script></div>
The <![CDATA[ ... ]] element is different. It is not rendered in my page. I tried using 3.2.0 snapshot, but the same happens. But there is a difference also between 3.1.3 and 3.2.0. That is - when I have no declaration of rich:dragIndicator in my page, there is nothing rendered while dragging an object with 3.1.3, but there is a dashed border in 3.2.0, that turns red and green - depending on the dropSupport accepted types. But that is not enough for me, I want to make it perfect... So I guess I will need your help - why is this CDATA element not rendered under my conditions? I will appreciate your help, because I have a close deadline guys, thanks in advance!