How to break at the end of the checkbox line

Asked

Viewed 527 times

1

The courses are coming out without formatting, there are more courses and are not appearing on the registration screen.

Cursos da tela

How to break this in XHTML?

Code:

<h:panelGrid columns="2" cellpadding="5">
<p:outputLabel value="Cursos" for="cursos" />
                <p:selectManyCheckbox id="cursos" styleClass="many-checkbox" value="#{cadastroCicloBean.ciclo.cursos}" 
                    converter="cursoConverter" required="true" requiredMessage="Por favor, informe a data de Inicio">
                        <f:attribute name="collectionType" value="java.util.ArrayList"/>
                        <f:selectItems value="#{cadastroCicloBean.cursos}" var="curso" itemLabel="#{curso.nome}" itemValue="#{curso}" />
                </p:selectManyCheckbox>     
</h:panelGrid>

1 answer

1


You can use Grid Layout by setting the number of columns or use the Responsive layout (also with the number of columns).

<h3>Grid Layout</h3>
<p:selectManyCheckbox id="grid" value="#{checkboxView.selectedCities}" layout="grid" columns="3">
    <f:selectItems value="#{checkboxView.cities}" var="city" itemLabel="#{city}" itemValue="#{city}" />
</p:selectManyCheckbox>

<h3>Responsive (since v5.2.4)</h3>
<p:selectManyCheckbox id="grid2" value="#{checkboxView.selectedCities2}" layout="responsive" columns="3">
    <f:selectItems value="#{checkboxView.cities}" var="city" itemLabel="#{city}" itemValue="#{city}" />
</p:selectManyCheckbox>

Source: Primefaces Showcase

Browser other questions tagged

You are not signed in. Login or sign up in order to post.