According to the tag library for http://xmlns.jcp.org/jsf/html , h:panelGroup -
Designed for use in situations where only one UIComponent Child can be nested, for example, in the case of facets. If the attributes are "style" or "styleClass", and the "Location" attribute is present with the value "block", displays the "div" element, the output of the value of the attribute "style" as the value of the attribute "style" and the value of the attribute "styleClass" as the value of the class attribute. Otherwise, if the "layout" attribute is not present, or the "layout" attribute contains a value other than "block", visualize the "span" element, displaying the value of the "style" attribute as the value of the "style" attribute, as well as the value of the "styleClass attribute "as the value of the" class "attribute.
When
<h:panelGroup id="id" layout="block"> </h:panelGroup>
or
<h:panelGroup layout="block" style="margin-right: 10px;"> </h:panelGroup>
a div :
<div id="id"> </div>
relevant
<div style="margin-right: 10px;"> </div>
but if there is no id (if you do not want to update panelGroup ) or style (if you do not want to erase panelGroup ), then there is no div and the resulting HTML can ruin the layout. In addition, exploring the JSF domain, a panelGroup can also be used to conditionally render children using its rendered flag, but, as mentioned earlier, when omitting the two specified attributes, the result is rendered conditionally, but without a div , for example
<h:panelGroup layout="block" rendered="true"> <it>Without DIV.</it> </h:panelGroup>
leads to
<it>Without DIV.</it>
After this request, I want to check with the Stackoverflow community that I correctly understood that when you do not use panelGroup as a naming container or for the usual style of its elements, it is better to solve the conditional rendering part (if necessary) using ui:fragment and the mock part with hard-coded div . This is true?
jsf
Smutje
source share