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
Joseph BauerJoseph Bauer 

How to Add Text and Selectlist in Column Header

I'm trying to add a Status label and a select list in a column header so it says Status and the user can select a new status in the header to apply to change all values in the column. Here is the markup:
 
<apex:column><apex:facet name="header">Status <br/>
                     <apex:selectList multiselect="false" size="1" value="{!selectedStatus}" required="false" id="status" label="Status">
                          <apex:selectOptions value="{!statusOptions}"/>
                        </apex:selectList>
                 </apex:facet>
                        {!rec.newStatusValue}
</apex:column>

This just shows a selectList in the header and Status is not rendered. If I change the picklist to just text (IE Status2) it renders both lines correctly. I also tried using a label on the SelectList but that did not work either. Anyone know how to do this?
Best Answer chosen by Joseph Bauer
Joseph BauerJoseph Bauer
I figured it out:
 
<apex:column>
                 <apex:facet name="header">
                  <apex:outputPanel layout="none">
                    <apex:outputLabel value="{!$ObjectType.Case.Fields.Status.Label}"/><br />
                    <apex:selectList multiselect="false" size="1" value="{!selectedStatus}" required="false" id="status" label="Status">
                          <apex:selectOptions value="{!statusOptions}"/>
                        </apex:selectList>
                  </apex:outputPanel>
                </apex:facet>               
                        {!rec.newStatusValue}
                 </apex:column>

 

All Answers

Joseph BauerJoseph Bauer
That doesn’t help me. I know how to make a selectList. I just don’t know how to get text and a selectList inside a column on a table
Joseph BauerJoseph Bauer
I figured it out:
 
<apex:column>
                 <apex:facet name="header">
                  <apex:outputPanel layout="none">
                    <apex:outputLabel value="{!$ObjectType.Case.Fields.Status.Label}"/><br />
                    <apex:selectList multiselect="false" size="1" value="{!selectedStatus}" required="false" id="status" label="Status">
                          <apex:selectOptions value="{!statusOptions}"/>
                        </apex:selectList>
                  </apex:outputPanel>
                </apex:facet>               
                        {!rec.newStatusValue}
                 </apex:column>

 
This was selected as the best answer