How to add comment in h:panelGrid without causing it to generate empty TD
Asked Answered
E

0

6

I've found that if I add comment inside panelgrid tag, it will generate an empty <td> for it. I've found this link about this issue: https://java.net/jira/browse/JAVASERVERFACES-1768. According to this link, it is not a bug and marked as WONTFIX. In the link, someone has provided these workarounds, I wonder if there are better solutions than these:

  1. Let Facelets ignore all comments, if you do not want to keep them at all. There is a javax.faces.FACELETS_SKIP_COMMENTS switch for that in web.xml.

  2. Move the comment into the <h:panelGroup>, if you want to keep them.

  3. Use <ui:remove><!-- first column --></ui:remove>, you could then also ignore the XML comment-style and come up with something fancier.

Endolymph answered 14/11, 2013 at 15:43 Comment(2)
That's pretty much it. As to choosing the one or the other, what do you feel most comfortable with? What's for you the most easy and best maintainable? Pick that.Antiquarian
Thanks BalusC. Since I'm converting from jsf1.2 to jsf 2.0, easier would be option 1. Sounded crazy to mark such as wontfix...Endolymph

© 2022 - 2024 — McMap. All rights reserved.