Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When should I use JSF components and when should I use html tags? [closed]

Tags:

html

jsf

I would like to design a webpage using JSF.

Some parts of the page I can layout using <h:panelGroup> and <h:panelGrid> or, instead, I can use <p>, <div>, etc instead.

Just wondering which is preferable for best practices.

Thanks!

like image 783
Ben Avatar asked Mar 21 '11 09:03

Ben


1 Answers

If you don't need the features provided by the JSF tag, I'd prefer to use plain HTML.

For example, <h:panelGroup> has a rendered attribute that allows you bind to a backing bean boolean variable to conditionally display the output, but with a <div> or <span>, you cannot do this.

The <h:panelGroup> will by default generate a <span>. If you prefer a <div>, then you can use <h:panelGroup layout="block">. It will generate a <div>for you .

like image 137
Ken Chan Avatar answered Oct 19 '22 10:10

Ken Chan