tags:

views:

4481

answers:

2

Eg h:inputText will render a "input type='text'". What jsf tag can render a "div" tag?

+8  A: 

You can create a DIV component using the <h:panelGroup/>. By default, the <h:panelGroup/> will generate a SPAN in the HTML code.

However, if you specify layout="block", then the component will be a DIV in the generated HTML code.

<h:panelGroup layout="block"/>
romaintaz
+1  A: 

Apart from the componen (which comes as a bit of a surprise to me),You could use a tag with the escape param set to false to generate any mark-up you want. For example:

<f:vertibam escape="true">
    <div id="blah"></div>
</f:vertibam>

Bear in mind it's a little less elegant than the panelgroup solution, as you have to generate this for both the start and end tags if you want to wrap any of your jsf code with the div.

Alternativly, all the major UI Frameworks have a div component tag, or you could write your own.

Nick Grubb