什么时候应该使用JSF组件,什么时候应该使用html标记? [英] When should I use JSF components and when should I use html tags?
问题描述
我想用JSF设计一个网页。
我可以使用< h:panelGroup>
和< h:panelGrid>
,或者我可以使用< p>
,< div>
等。
感谢!
如果您不需要JSF提供的功能标记,我宁愿使用纯HTML。
$ b 例如,< h:panelGroup>
有一个呈现
属性,允许您绑定到一个支持bean布尔变量来有条件地显示输出,但是使用< div>
或< span> ;
,你不能这样做。
$ b $ <
< h:panelGroup>
将会默认情况下会生成一个< span>
。如果您喜欢< div>
,那么您可以使用< h:panelGroup layout =block>
。它会为你生成一个< div>
。 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!
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 .
这篇关于什么时候应该使用JSF组件,什么时候应该使用html标记?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!