I have created web-application using JSF 2.0 where I have checkbox to select as h:selectManyCheckbox
. Below is what I have as code
<h:selectManyCheckbox value="#{UserRegistration.pagesSelected}" id="myPages">
<f:selectItem itemValue="registerForPatentss" itemLabel="Register New Applicant"/>
<f:selectItem itemValue="success" itemLabel="Register New Project" />
<f:selectItem itemValue="getReportss" itemLabel="Patent Reports" />
<f:selectItem itemValue="searhPatentss" itemLabel="Search For Project" />
<f:selectItem itemValue="addUserss" itemLabel="Add User Account" />
<f:selectItem itemValue="logPatentSystemss" itemLabel="System Log" />
<f:selectItem itemValue="userlistss" itemLabel="Details Of Registered Users" />
</h:selectManyCheckbox>
Output I get is
[] Register New Applicant [] Register New Project [] Patent Reports [] Search For Project [] Add User Account [] System Log [] Details Of Registered Users
The problem is This is on ONE LINE.
What I want is as below.
[] Register New Applicant [] Register New Project [] Patent Reports [] Search For Project
[] Add User Account [] System Log [] Details Of Registered Users
i.e. 4 checkboxes on one line....
Any idea how to get this done?
HTML generated output is
<table id="myPages">
<tr>
<td>
<input name="myPages" id="myPages:0" value="registerForPatentss" type="checkbox" checked="checked" /><label for="myPages:0" class=""> Register New Applicant</label></td>
<td>
<input name="myPages" id="myPages:1" value="success" type="checkbox" checked="checked" /><label for="myPages:1" class=""> Register New Project</label></td>
<td>
<input name="myPages" id="myPages:2" value="getReportss" type="checkbox" checked="checked" /><label for="myPages:2" class=""> Patent Reports</label></td>
<td>
<input name="myPages" id="myPages:3" value="searhPatentss" type="checkbox" checked="checked" /><label for="myPages:3" class=""> Search For Project</label></td>
<td>
<input name="myPages" id="myPages:4" value="addUserss" type="checkbox" checked="checked" /><label for="myPages:4" class=""> Add User Account</label></td>
<td>
<input name="myPages" id="myPages:5" value="logPatentSystemss" type="checkbox" checked="checked" /><label for="myPages:5" class=""> System Log</label></td>
<td>
<input name="myPages" id="myPages:6" value="userlistss" type="checkbox" /><label for="myPages:6" class=""> Details Of Registered Users</label></td>
</tr>
</table>
Take a look at tomahawk's <t:selectManyCheckbox>
with a straightforward usage description e.g. here.