2

is there a way to remove the table out of rendered html that is created by the h:selectManyCheckbox tag in server faces?

I am using twitter bootstrap and i placed the checkboxes inside a dropdown menu:

<ul class="dropdown-menu dropdown-menu-form">
    <li><label class="checkbox"> <input type="checkbox" />
            Activated
    </label></li>
    <li><label class="checkbox"> <input type="checkbox" />
            Deactivated
    </label></li>
</ul>

So the generated html table destroys the layout ...

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Marcello90
  • 1,313
  • 4
  • 18
  • 33

1 Answers1

5

You could just render a bunch of <h:outputLabel><h:selectBooleanCheckbox> inside <ui:repeat>. This way you've markup freedom. You'll only need to alter the model from e.g. List<T> to Map<T, Boolean> to represent the checked values and then loop over the map afterwards to collect checked ones.

A ready-to-use component is Tomahawk's <t:selectManyCheckbox> which has an additional layout attribute value of spread.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555