0

what is causing this error?

<apex:page controller="wrapper_test_controller"  > 
    <apex:form >
        <apex:pageblock >

                 <strong>   Welcome  {!$User.FirstName} {!$User.LastName}!
                    <apex:outputLabel style="float:right" > Date: {!MONTH(TODAY())}/ {!DAY(TODAY())}/ {!YEAR(TODAY())} </apex:outputLabel>
                 </strong>
                    <br></br>
                    <br></br>
         <apex:outputText >Select Student:</apex:outputText>
                <apex:selectList size="1">

                    <apex:selectOptions value="{!Stud}"/>
                </apex:selectList>
         <apex:pageblocktable value="{!schedules}" var="schedule">
          <apex:column headerValue="Teacher"  id="teacher" value=" {!schedule.obj1.name}, {!schedule.obj1.First_Name__c}" />
          <apex:column headerValue="Subject" value="{!schedule.obj1.Subject__c}"/>
          <apex:column headerValue="Room Assignment" value="{!schedule.obj1.Room_Assignment__c}"/>
          <apex:column headerValue="Time" id="time1"  Value="{!schedule.obj2.time__c}">
          <apex:selectList multiselect="false" size="1">
             <apex:selectOption itemValue="9:00 AM" itemLabel="9:00 AM"/>
             <apex:selectOption itemValue="10:00 AM" itemLabel="10:00 AM"/>
             <apex:selectOption itemValue="11:00 AM" itemLabel="11:00 AM"/>
             <apex:selectOption itemValue="1:00 PM" itemLabel="1:00 PM"/>
             <apex:selectOption itemValue="2:00 PM" itemLabel="2:00 PM"/>
             <apex:selectOption itemValue="3:00 PM" itemLabel="3:00 PM"/>
             <apex:selectOption itemValue="4:00 PM" itemLabel="4:00 PM"/>
             <apex:selectOption itemValue="5:00 PM" itemLabel="5:00 PM"/>
          </apex:selectList>  
          <apex:pagemessages />
          </apex:column>
                <apex:column headerValue="Check Time" >
              <apex:inputCheckbox value="{!schedule.obj1.Id}"> 
                  <apex:actionSupport event="onclick"
                        action="{!check}"
                        reRender="ResultPanel">
              <apex:param id="teacherid" name="teacherId" value="{!schedule.obj1.Id}"
                    assignTo="{!selectedTid}"/>
              <apex:param id="schedTime" name="schedTime" value="{!schedule.obj2.time__c}"
                    assignTo="{!selectedTime}"/>
        </apex:actionSupport>
               </apex:inputCheckbox>
             </apex:column>

          </apex:pageblocktable>
        <apex:pageBlockButtons >


        </apex:pageBlockButtons>
         <br/>       
        </apex:pageblock>
    </apex:form>
</apex:page>
  • as far as I get it -- instead of this two lines: <apex:column headerValue="Time" id="time1" Value="{!schedule.obj2.time__c}" **><apex:selectList multiselect="false" size="1"> you should make this : <apex:column headerValue="Time" id="time1" ><apex:selectList multiselect="false" size="1" Value="{!schedule.obj2.time__c}" > – kurunve Feb 16 '16 at 8:12
  • Please put more effort into removing irrelevant markup. The error message itself should lead you straight to which column tag to look at, if not the cause. – Adrian Larson Feb 16 '16 at 14:55
2

Your 4th column time1 in the pageBlockTable is having both the value attribute bound to a field and also has a selectList inside it.

   <apex:column headerValue="Time" id="time1"  Value="{!schedule.obj2.time__c}">
      <apex:selectList multiselect="false" size="1">
         <apex:selectOption itemValue="9:00 AM" itemLabel="9:00 AM"/>
         <apex:selectOption itemValue="10:00 AM" itemLabel="10:00 AM"/>
         <apex:selectOption itemValue="11:00 AM" itemLabel="11:00 AM"/>
         <apex:selectOption itemValue="1:00 PM" itemLabel="1:00 PM"/>
         <apex:selectOption itemValue="2:00 PM" itemLabel="2:00 PM"/>
         <apex:selectOption itemValue="3:00 PM" itemLabel="3:00 PM"/>
         <apex:selectOption itemValue="4:00 PM" itemLabel="4:00 PM"/>
         <apex:selectOption itemValue="5:00 PM" itemLabel="5:00 PM"/>
      </apex:selectList>  
     <apex:pagemessages />
    </apex:column>

You have to use either one of them not both. So if you remove either the value attribute or the selectList out of the column, it should work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.