On Tue, May 12, 2009 at 3:47 PM, Martin Marinschek
<mmarinschek@apache.org> wrote:
Hi Andy,
one more issue which _always_ comes up with people working with
facelets and of course also stems from the same root-cause is the
comment-problem - how can you correctly have comments for facelets and
comments for the output?
The way we currently do this is either set SKIP_COMMENTS to true -
which effectively disallows HTML comments - or use ui:remove to make
parts of the page Facelets-comments. However, the second approach
doesn't allow invalid XML-snippets inside the ui:remove section - and
this can be a very annoying thing then.
Maybe it would be better to set SKIP_COMMENTS to true by default - and
then have an <h:outputComment> for emitting HTML comments (I believe
the problem of invalid XML in HTML-comments is not as big as in
comments which are meant to be there for facelets).
Martin, you have struck a very strong chord with me. I was just dealing with this exact issue all week. To create a real Facelets comment, putting SKIP_COMMENTS aside, I have to do:
<ui:remove><!--
I'm thinking of using <rich:dataTable> but I haven't added the RichFaces libraries yet.
--></ui:remove>
To me, that seems like complete overkill. I would much prefer if Facelets just stayed out of comments and like Martin said, we consider producing a comment with a tag (since producing a comment is extremely rare anyway). I would even support the idea of using comment markers inside the tag so that it is still possible to use invalid XML.
<h:outputComment><!--
This is a comment with invalid <<XML>>
--></h:outputComment>
Of course, the comment markers would be optional...they just allow the template to be well-formed XML if you happen to use invalid markup in the comment.
-Dan