Hi all,
one question just came to my mind... When using HTML templates in conjunction
with view composition, I want to use HTML templates from my HTML designers and
exclude all the redundant stuff. Only the portion of the page containing my
body content (or footer panel or whatever) should be added to the component
tree. Today I have to add a jsfid="void" to EACH of the HTML tags of the
original HTML template to exclude it from the component tree. To exclude whiole
blocks there is the possiblity o use jsfid="void" plus allowBody="false", but
this only works, if there's no real jsf component nested.
I'm thinking of something different - maybe some special HTML comment as marker
to exclude/include portions of the template:
<!-- ### clay:remove ### -->
<html ....
this is the basic layout to be removed when converting to an include
...
<div class="content">
<!-- ### /clay:remove ### -->
<!--
this is the body content to be placed
in the basic layout HTML template defined elsewhere
-->
<form>
<input type="text" value="#{contentBean.inputText}"/>
<input type="submit" action="#{contentBean.doSubmit}"/>
</form>
<!-- ### clay:remove ### -->
</div>
this is the basic layout to be removed when converting to an include
...
</html>
<!-- ### /clay:remove ### -->
In Facelets' HTML templates this is done in a reverse fashion. Everthing
outside special HTML-Tags is removed from the resulting component subtree:
<html xmlns:ui="some facelets uri" ...>
this is the basic layout to be removed when converting to an include
...
<div class="content">
<ui:composite ...>
<!-- everything outside this tag is stripped -->
<form jsfc="h:form">
<input jsfc="h:inputText" type="text" value="#{contentBean.inputText}"/>
<input jsfc="h:commandButton" type="submit"
action="#{contentBean.doSubmit}"/>
</form>
</ui:composite>
</div>
this is the basic layout to be removed when converting to an include
...
</html>
What do you think? Is this more a topic for the developer list?
Cheers,
René