-
1. Re: Seam 3 s:div tag?
oranheim Nov 12, 2010 10:11 AM (in response to msahin35)The s:div tag basically produces a div tag and enables the rendered attribute, so visibility can be turned on/off.
A replacement tag would be
<h:panelGroup layout="block">
Which also produces a div tag and let you control rendered attribute.
-
2. Re: Seam 3 s:div tag?
dan.j.allen Dec 3, 2010 5:40 PM (in response to msahin35)It's also easy to create this using a JSF 2 composite component:
1. Create the file /resources/htmlx/div.xhtml in your web root and populate it with this content:
<!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:cc="http://java.sun.com/jsf/composite" xmlns:h="http://java.sun.com/jsf/html"> <cc:interface></cc:interface> <cc:implementation> <div><cc:insertChildren/></div> </cc:implementation>
* You may be able to trim some characters in that template, play around with it
** I'm naming this library htmlx to meanextra html tags
2. Now import the namespace into your template and use it:
<!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" xmlns:x="http://java.sun.com/jsf/composite/htmlx"> <h:head> <title>Sample page</title> </h:head> <h:body> <x:div>Content in a div</x:div> </h:body> </html>
Voila.
-
3. Re: Seam 3 s:div tag?
tschleuss Oct 20, 2011 7:22 PM (in response to msahin35)But, with this, how can i make for example:
<s:span styleClass="required" rendered="#{required}">
<h:outputText value="*" title="Email" />
</s:span>With JSF 2 composite component, how can i implement
styleClass, redenred condition, etc ??I really need s:div and s:span, and others,
theres any alternative ?Thanks!
-
4. Re: Seam 3 s:div tag?
piklos Oct 24, 2011 3:24 AM (in response to msahin35)<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:composite="http://java.sun.com/jsf/composite"> <!-- INTERFACE --> <composite:interface> <composite:attribute name="styleClass" /> <composite:attribute name="rendered" /> </composite:interface> <!-- IMPLEMENTATION --> <composite:implementation> <h:panelGroup rendered="#{cc.attrs.rendered}"> <div class="#{cc.attrs.styleClass}"><cc:insertChildren/></div> </h:panelGroup> </composite:implementation> </html>
Try this.
-
5. Re: Seam 3 s:div tag?
tschleuss Oct 24, 2011 7:57 AM (in response to msahin35)Thanks, it work.
i didn't know this#{cc.attrs....}