function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
The KnightThe Knight 

How to arrange the checkboxes in vertical column instead of horizontal alignment.

     We are having two Lists of check box groups which are displayed in two pageblocksections> our requirement is to display the two groups in two columns.The code is like this
                        <apex:pageblockSection title="Rules" columns="0">
                        <apex:selectCheckboxes value="{!selectedRules}">
                                <apex:selectOptions value="{!rules}"/><br/>
                 <apex:pageblockSection title="Agents">
                    <apex:selectCheckboxes value="{!selectedAgents}">
                            <apex:selectOptions value="{!agents}"/><br/></p>
    Could any one suggest on how to align these two as two columns in a pageblock?


try <apex:datatable> or <apex:pageBlockTable>

Should do the trick!



The KnightThe Knight
   <apex:datatable> or <apex:pageBlockTable> don't work becoz we need value='{!some list of objects}" for these two.   
Does the layout attribute on selectCheckboxes give you what you need?

If you put them in two different pageBlockSections they are going to be two separate sections and It might be hard to get them into columns.  I'm not totally sure what look you're going for.
The KnightThe Knight
I want to display the check boxes in a table as two columns. The check boxes in a pageblock section should become a column of the table.
The two column values should be
           <apex:selectCheckboxes value="{!selectedRules}">
                                <apex:selectOptions value="{!rules}"/><br/>
  <apex:selectCheckboxes value="{!selectedAgents}">
           <apex:selectOptions value="{!agents}"/><br/></p>

The KnightThe Knight

Hi Jill ofcourse the layout attribute helps to display the elements in pageblocksection vertically. I have used one more pageblocksection which would be the parent of the other two pageblocksections. Now the page looks like this.



--------pageblocksection11(child1)----------       -----------pageblocksection12(child2)---------------

a1                                                                  b1
a2                                                                  b2
a3                                                                  b3

it may be late... but try the layout attribute in the <apex:SelectCheckBoxes> tag :

<apex:SelectCheckBoxes layout="PageDirection"  value={!SelectedCheckBoxes}>
    <apex:Selectoptions value={!SelectOptions}/>



When the layout is set to "PageDirection" the check boxes option will display on below the other, if not set or set to "inLineDirection" they display next to each other.




layout="pageDirection" is in only Radio button, select checkbos doesnt have that attribute

layout="pageDirection" Worked for me.

Thanks claper
thanks claper this worked for me!!!