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
RachaelCRachaelC 

Error: Select components should have at least one child component of type selectOption or selectOptions



Here is my code: 


                            <apex:selectList id="conlist" value="{!o.Partner_Contact__c}" size="1" style="width:160px">
                                <apex:repeat value="{!PartnerContactsNew}" var="Lists">
                                    <apex:repeat value="{!Lists}" var="list">
                                        <selectOptions value="{!list.value}">{!list.Label}</selectOptions>
                                    </apex:repeat>
                                </apex:repeat>
                            </apex:selectList>

Can someone please take a look as I am not sure what I am missing here. Thanks! 
Nilesh Jagtap (NJ)Nilesh Jagtap (NJ)
apex:selectlist must have a direct child as apex:selectoption or apex:selectoptions.
Try to include one of this as direct child of selectlist.


Thanks,
N.J
Vinit_KumarVinit_Kumar
Not sure what you are trying to do .Below is a sample code which would help you :-

VF page:-

<apex:page controller="sampleCon">
    <apex:form>
        <apex:selectList value="{!countries}" multiselect="true">
            <apex:selectOptions value="{!items}"/>
        </apex:selectList><p/>

        <apex:commandButton value="Test" action="{!test}" rerender="out" status="status"/>
    </apex:form>

</apex:page>

Apex Class :-

public class sampleCon {
        String[] countries = new String[]{};
            
        public PageReference test() {
            return null;
        }
            
        public List<SelectOption> getItems() {
            List<SelectOption> options = new List<SelectOption>();
            options.add(new SelectOption('US','US'));
            options.add(new SelectOption('CANADA','Canada'));
            options.add(new SelectOption('MEXICO','Mexico'));
            return options;
        }
            
        public String[] getCountries() {
            return countries;
        }
            
        public void setCountries(String[] countries) {
            this.countries = countries;
        }
    }
If this helps,please mark it as best answer to help others :)

Julian LeahJulian Leah

Social media is a tremendously growing community that can also earn great sums of money for you ,if used appropriately.Now https://www.resumehelpservices.com/ also provides services of buying likes and followers on facebook.