2016-01-10 1 views
1

Vous essayez d'éditer les champs affichés dans une page Visualforce et je suis novice en matière de codage. Je reçois ce message d'erreur (exemple):Erreur: Impossible de résoudre le champ <apex: inputField>

Error: Could not resolve field 'Student_Id__c' from <apex:inputField> value binding '{!att.Student_Id__c}' in page AddAttendee 

Toute aide serait grandement appréciée!

originale, la page de travail:

<apex:page controller="AddAttendee" id="page" showHeader="false"> 
    <c:CCHeader /> 
    <script type="text/javascript"> 
     var count = 0; 
     function funcA() { 
     //debugger; 
      if({!!setCount}){return;} 
      else{ 
       for(var a=0;a<=count;a++){ 
        var divObj = document.getElementById('page:formId:pageBlockId:pageBlockTableclsAttendees:'+a+':attCont'); 
        var child = divObj.children[0]; 
        child.style.textDecoration = 'none'; 
        child.style.color = 'black'; 
        child.removeAttribute('href'); 
        child.removeAttribute('onblur'); 
        child.removeAttribute('onfocus'); 
        child.removeAttribute('onmouseout'); 
        child.removeAttribute('onmouseover'); 

       } 
       count++; 
      } 
     } 

    </script> 
    <apex:form id="formId"> 
     <apex:outputPanel id="errorPanelId"> 
      <apex:pageMessages /> 
     </apex:outputPanel> 
     <apex:pageBlock id="pageBlockId"> 
      <apex:pageBlockButtons > 
       <apex:commandButton value="Save" action="{!doSave}" rerender="errorPanelId" /> 
       <apex:commandButton value="Cancel" action="{!cancelSave}" rerender="errorPanelId" /> 
      </apex:pageBlockButtons> 

      <apex:pageBlockSection id="SectionId1" columns="4"> 
       <apex:pageBlockSectionItem > 
        <apex:outputLabel value="Select Contact: " /> 
        <apex:inputField value="{!att.Contact__c}" required="false"/> 
       </apex:pageBlockSectionItem> 
       <apex:pageBlockSectionItem > 
        <apex:commandButton value="Add" action="{!AddContact}" oncomplete="funcA();" rerender="pageBlockId,SectionId1,PanelId,pageBlockTableclsAttendees"/> 
       </apex:pageBlockSectionItem> 
      </apex:pageBlockSection> 

      <apex:outputPanel id="PanelId" > 
       <apex:pageBlockTable id="pageBlockTableclsAttendees" value="{!tempList}" var="att" rendered="{!tempList.size > 0}"> 
        <apex:column headerValue="Attendee Name"> 
         <apex:outputField StyleClass="AttendeeName" id="attCont" value="{!att.Contact__c}" /> 
        </apex:column> 
        <apex:column headerValue="Student ID Number"> 
         <apex:inputField id="attStudentId" value="{!att.Student_Id__c}" />  
        </apex:column> 
        <apex:column headerValue="Gender"> 
         <apex:inputField id="attGender" value="{!att.Gender__c}" /> 
        </apex:column> 
        <apex:column headerValue="Amount Paid"> 
         <apex:inputField id="attAmount" value="{!att.Amount_Paid__c}" /> 
        </apex:column> 
       </apex:pageBlockTable> 
      </apex:outputPanel> 
     </apex:pageBlock> 
    </apex:form> 
</apex:page> 

Modifier Je souhaite faire:

<apex:page controller="AddAttendee" id="page" showHeader="false"> 
     <c:CCHeader /> 
     <script type="text/javascript"> 
      var count = 0; 
      function funcA() { 
      //debugger; 
       if({!!setCount}){return;} 
       else{ 
        for(var a=0;a<=count;a++){ 
         var divObj = document.getElementById('page:formId:pageBlockId:pageBlockTableclsAttendees:'+a+':attCont'); 
         var child = divObj.children[0]; 
         child.style.textDecoration = 'none'; 
         child.style.color = 'black'; 
         child.removeAttribute('href'); 
         child.removeAttribute('onblur'); 
         child.removeAttribute('onfocus'); 
         child.removeAttribute('onmouseout'); 
         child.removeAttribute('onmouseover'); 

        } 
        count++; 
       } 
      } 

     </script> 
     <apex:form id="formId"> 
      <apex:outputPanel id="errorPanelId"> 
       <apex:pageMessages /> 
      </apex:outputPanel> 
      <apex:pageBlock id="pageBlockId"> 
       <apex:pageBlockButtons > 
        <apex:commandButton value="Save" action="{!doSave}" rerender="errorPanelId" /> 
        <apex:commandButton value="Cancel" action="{!cancelSave}" rerender="errorPanelId" /> 
       </apex:pageBlockButtons> 

       <apex:pageBlockSection id="SectionId1" columns="5"> 
        <apex:pageBlockSectionItem > 
         <apex:outputLabel value="Select Contact: " /> 
         <apex:inputField value="{!att.Contact__c}" required="false"/> 
        </apex:pageBlockSectionItem> 
        <apex:pageBlockSectionItem > 
         <apex:commandButton value="Add" action="{!AddContact}" oncomplete="funcA();" rerender="pageBlockId,SectionId1,PanelId,pageBlockTableclsAttendees"/> 
        </apex:pageBlockSectionItem> 
        </apex:pageBlockSectionItem> 
       </apex:pageBlockSection> 

       <apex:outputPanel id="PanelId" > 
        <apex:pageBlockTable id="pageBlockTableclsAttendees" value="{!tempList}" var="att" rendered="{!tempList.size > 0}"> 
         <apex:column headerValue="Attendee Name"> 
          <apex:outputField StyleClass="AttendeeName" id="attCont" value="{!att.Contact__c}" /> 
         </apex:column> 
         <apex:column headerValue="Student ID Number"> 
          <apex:inputField id="attStudentId" value="{!att.Student_Id__c}" />  
         </apex:column> 
         <apex:column headerValue="Gender"> 
          <apex:inputField id="attGender" value="{!att.Gender__c}" /> 
         </apex:column> 
         <apex:column headerValue="Ethnicity"> 
          <apex:inputField id="attEthnicity" value="{!att.Ethnicity__c}" /> 
         </apex:column> 
         <apex:column headerValue="Grade"> 
          <apex:inputField id="attGrade" value="{!att.Grade__c}" /> 
         </apex:column> 
         <apex:column headerValue="School"> 
          <apex:inputField id="attSchool" value="{!att.School__c}" /> 
         </apex:column> 

        </apex:pageBlockTable> 
       </apex:outputPanel> 
      </apex:pageBlock> 
     </apex:form> 
    </apex:page> 
+1

Demandez-vous 'Student_Id__c' dans la requête qui génère' tempList'? Avez-vous vérifié que ce champ est visible pour tous les profils? –

Répondre

0

problème est pas lié à la visibilité du terrain. Le problème est qu'il n'y a pas de champ nommé Student_Id__c sur l'objet Attendee ou que vous avez mal orthographié le nom de l'API du champ. Ou peut-être Student_Id__c est le champ de son Parent. Faites-moi savoir si je ne suis pas clair.