What jsf component can render a div tag?

前端 未结 5 564
面向向阳花
面向向阳花 2020-11-28 21:09

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

相关标签:
5条回答
  • 2020-11-28 21:15

    I think we can you use verbatim tag, as in this tag we use any of the HTML tags

    0 讨论(0)
  • 2020-11-28 21:20

    In JSF 2.2 it's possible to use passthrough elements:

    <html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:jsf="http://xmlns.jcp.org/jsf">
        ...
        <div jsf:id="id1" />
        ...
    </html>
    

    The requirement is to have at least one attribute in the element using jsf namespace.

    0 讨论(0)
  • 2020-11-28 21:22

    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"/>
    
    0 讨论(0)
  • 2020-11-28 21:24

    you can use myfaces tomahawk component

    http://myfaces.apache.org/tomahawk-project/tomahawk12/tagdoc/t_div.html

    0 讨论(0)
  • 2020-11-28 21:35

    Apart from the <h:panelGroup> component (which comes as a bit of a surprise to me), you could use a <f:verbatim> tag with the escape parameter set to false to generate any mark-up you want. For example:

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

    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 tag.

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

    0 讨论(0)
提交回复
热议问题