Magazine
 

Facelet

 

Rendered Output:

10. Facelet remove tag

This tag is used to remove content within this tag from a facelet at compile time. This tag don’t have any attribute. This tag can be used with jsfc attribute which shows that the particular tag will be removed. In this example, the line “This line will be removed” will be removed from facelet at the time of compilation and so will not be displayed. In this example, the line where jsfc attribute is used and set to the ui:remove is not considered for compilation so input text box for this line of code will not be displayed.

 

remove.xhtml:

<!DOCTYPE html PUBLIC “-//W3C//DTD
XHTML 1.0 Transitional//EN” “http://
www.w3.org/TR/xhtml1/DTD/xhtml1-
transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/
xhtml”
xmlns:ui=”http://java.sun.com/jsf/facelets”
xmlns:h=”http://java.sun.com/jsf/html”>
<body>
<h2>Java Jazz Up</h2>
<h3>Facelet Examples</h3>
<hr/>
<ui:decorate template=”/pages/remove/
removetemplate.xhtml”>
<ui:define name=”face1">
<h3><h:outputText value=”This is the
text to be displayed.”/></h3>
<input type=”text” jsfc=”h:inputText”
value=”This i/p box is rendered” />
<input type=”text” jsfc=”ui:remove”
value=”IT” />
<ui:remove>This line will be removed</
ui:remove>
</ui:define>
</ui:decorate>
<hr/><h3>This is the content below
decorate tag.</h3>
</body>
</html>

removetemplate.xhtml

<!DOCTYPE html PUBLIC “-//W3C//DTD
XHTML 1.0 Transitional//EN” “http://
www.w3.org/TR/xhtml1/DTD/xhtml1-
transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/
xhtml”
xmlns:ui=”http://java.sun.com/jsf/
facelets”>
<head>
<title>Facelet remove tag example</title>
<link href=”../../style/CSS.css”
rel=”stylesheet” type=”text/css”/>
</head>
<body>
<ui:insert name=”face1"></ui:insert>
</body>
</html>
Jan 2008 | Java Jazz Up | 87
previous
index
next
 
View All Topics
All Pages of this Issue
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,

30
, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53 , 54, 55, 56, 57,

58
, 59, 60, 61, 62, 63 , 64, 65 , 66 , 67 , 68 , 69 , 70 , 71 , 72 , 73 , 74 , 75 , 76 , 77 , 78 , 79 , 80 , 81 , 82 ,

83, 84 , 85 , 86, 87 , 88, 89 , 90 , 91 , 92 , 93 , 94 , 95 , 96 , 97 , 98 , 99 , 100 , 101 , 102 , 103, 104 , 105 ,

106, 107,

Download PDF