Help

Built with Seam

You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.

Your first instinct may be either to use an HTML comment or a JSP comment. An HTML comment will only work if Facelets is setup to ignore HTML comments. Otherwise, the block is interpreted and encoded into the response as an HTML comment. A JSP comment will not work because a Facelets template is not interpreted by the JSP compiler and Facelets doesn't not honor such invalid XML.

So what is a developer to do? Fortunately, Facelets provides a special tag for ignoring blocks of template markup, <ui:remove>. When Facelets comes across this tag, it simply skips over that branch of the XML. No component is created and thus JSF is not aware of the presence of this tag or any of its children. The only catch is that the <ui:remove> tag must fit into the template as valid XML.

<h:panelGroup>
    <h:commandButton action="#{editor.save}" value="Save"/>
    <ui:remove>
        Not yet implemented
        <h:commandButton action="#{editor.delete}" value="Delete"/>
    </ui:remove>
</h:panelGroup>