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
Behzad Bahadori 18Behzad Bahadori 18 

page Block Section Item for Multi Select Option

Hi I get the following error for pageblockSectionItem. I need to make this fields visible only for certain profiles  I have few more selectOptin that I need to add
Error " Error: <apex:pageBlockSectionItem> may have no more than 2 child components"
<apex:pageBlockSectionItem rendered="{!IF($UserRole.Name =='User' || $UserRole.Name =='Salesforce Administrator'  , true , false)}">
      <td class="labelCol" style="border-bottom:0px;">
                  <apex:outputLabel value="Expiration Date (Mo/Yr)"/>
                </td>
                <td class="data2Col" style="border-bottom:0px;">
                <apex:selectList id="sandler"  value="{!sandlerAccount}" size="1">
                    <apex:selectOption itemValue="" itemLabel="-- None --"/>
                    <apex:selectOption itemValue="test" itemLabel="tt/>
                    <apex:selectOption itemValue="test2" itemLabel="tt"/>     
        
                </apex:selectList>

        </td>

 
Best Answer chosen by Behzad Bahadori 18
GauravGargGauravGarg
Hi Behzad,

Please try using below code:

<apex:pageBlockSectionItem rendered="{!IF($UserRole.Name =='User' || $UserRole.Name =='Salesforce Administrator'  , true , false)}">
            <apex:outputPanel>
                <td class="labelCol" style="border-bottom:0px;">
                  <apex:outputLabel value="Expiration Date (Mo/Yr)"/>
                </td>
            
                <td class="data2Col" style="border-bottom:0px;">
                    <apex:selectList id="sandler"  value="{!sandlerAccount}" size="1">
                        <apex:selectOption itemValue="" itemLabel="-- None --"/>
                        <apex:selectOption itemValue="test" itemLabel="tt/>
                        <apex:selectOption itemValue="test2" itemLabel="tt"/>     
                    </apex:selectList>
                </td>    
            </apex:outputPanel>