JSF: More customizable selectManyCheckbox and selectOneRadio

前端 未结 1 477
别跟我提以往
别跟我提以往 2021-01-27 03:38

I\'m using selectManyCheckboxes and selectOneRadios and I would like to customize them in some way. It would be sufficient if there was be a possibilty to group the selectItems

相关标签:
1条回答
  • 2021-01-27 04:21

    Yes, certainly this is possible. You've already made a good choice with Tomahawk. It's namely one of the very few component libraries which provides components which allows you to position checkboxes and radiobuttons everywhere the way you want instead of ending up with them in a table as the standard components do.

    Here's a kickoff example with <t:selectOneRadio> (note the new layout="spread" attribute, the JSF defaults are pageDirection and lineDirection) and <t:radio>.

    <t:selectOneRadio id="foo" value="#{bean.selectedItem}" layout="spread">
        <f:selectItems value="#{bean.selectItems}" />
    </t:selectOneRadio>
    
    <p><t:radio for="foo" index="0" /> radio in paragraph</p>
    <h1><t:radio for="foo" index="1" /> radio in heading</h1>
    <hr />
    <p><t:radio for="foo" index="2" /> radio after horizontal rule</p>
    

    The <t:selectManyCheckbox> also supports layout="spread" with <t:checkbox> the same way.

    This allows for more fine grained HTML/CSS markup on and around those buttons/checkboxes.

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