You need to sign in to do that
Don't have an account?

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"
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>
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>