Saturday, January 10, 2009

Facelets Template-Parameter

Es gibt mehrere Möglichkeiten Facelets-Templates zu parameterisieren.
  1. Über ui:insert und ui:define
  2. Über EL und ui:param
Facelets Template:

<html>
<head>
<link rel="stylesheet" type="text/css" href="#{myStylesheet}" media="screen, projection" />
</head>
<body>
<ui:insert name="myContent">No content supplied.</ui:insert>
</body>
</html>

Facelets Template-Client:

<ui:composition template="MyTemplate.xhtml">
<ui:param name="myStylesheet" value="http://my.host.com/css/style.css" />
<ui:define name="content">
<h1>My Content</h1>
</ui:define>
</ui:composition>


Über ui:insert ist es möglich Blockplatzhalter zu definieren.
Mit ui:param können auch Inline-Passagen definiert werden.

Die Frage wurde in unserem XING JSF-Developers-Forum (https://www.xing.com/net/jsf) gestellt.

3 comments:

  1. thanks, perfect hint ;)

    ReplyDelete
  2. Thanks, just what i've been looking for ;)

    ReplyDelete
  3. Good post. This is a very nice blog that I will definitively come back to more times this year! Thanks for informative post. I am sure this post has helped me save many hours of browsing other similar posts just to find what I was looking for.
    There are many brand from France, also including herve leger, and most of womens stars love wearing herve leger dress when they join in some important party. Now polo ralph lauren is very popular with youthful people, everyone want to get ralph lauren polo shirts, there are lots of online shop which are ralph lauren polo outlet, true religion jeans outlet, it will be convenient for us.

    ReplyDelete