views:

90

answers:

3

Can someone point to me or explain if this is true, you must not use plain any plain HTML tags in JSF or JSF libraries like RichFaces?

We're using JSF 1.2, RichFaces 3.3.3 and Facelets on JBOSS server.

Someone said to me that we must use only <rich:> or <f:> or <a4j:> and the components they offer. Reason being that the JSF component tree would break and you may have unwanted behaviour. Or lose the JSF tree structure at some point and the functionality associated with it.

I was trying to use a plain <h1> tag and was told to not use it and use a <a4j:outputPanel> instead (which renders as a <div>) and style it to look like a heading.

I'm having a hard time believing this.

+4  A: 

You are right not to believe this. There is absolutely no problem in using plain HTML tags.

Facelets creates UIComponents even for static markup (i.e. non-JSF). It should just be valid.

Bozho
Bozho, could you give me some thing more, like a reference perhaps to conclusively prove this?
Moin Zaman
@Moin Zaman - first, which version are you using, and are you using jsp or facelets.
Bozho
@Bozho: We're using JSF and Facelets with RichFaces 3.3.3
Moin Zaman
edit: JSF version 1.2
Moin Zaman
+2  A: 

There were some limitations in mixing jsf and hthml in jsf 1.0 and 1.1 . You had to use the <f:verbatim> tag to render your html correctly. Maybe the person that told told you not to use plain html had this limitation in mind.

gedim
Yes, they did show me some documentation about this. However, the current documentation actually says not to use `<f:verbatim>` for self rendered containers. see: http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/ArchitectureOverview.html#LimitationsAndRules
Moin Zaman
A: 

I'll confirm what has been said, you can easily mix and match HTML and RichFaces tags.

Max Katz