0

I am trying to Create Wizard for Custom Object

Here is my Apex Code:

public class Pageniation {
public FeedbackFrom__c Fed{get;set;}

 public FeedbackFrom__c getFed() {
      if(Fed== null) Fed = new FeedbackFrom__c();
      return Fed;
   }
    public PageReference step1() {
      return Page.Newtest;
   }

   public PageReference step2() {
      return Page.Newtest2;
   }

   public PageReference step3() {
      return Page.Newtest3;
   }
 public PageReference cancel() {
            PageReference FeedbackPage = new ApexPages.StandardController(Fed).view();
            FeedbackPage.setRedirect(true);
            return FeedbackPage; 
    }
public PageReference save() {

PageReference FeedbackPage = new ApexPages.StandardController(Fed).view();
      FeedbackPage.setRedirect(true);

      return FeedbackPage;
   }

}

Here is my VF Code:

<apex:page controller="Pageniation" tabStyle="FeedbackFrom__c">
  <script>
  function confirmCancel() {
      var isCancel = confirm("Are you sure you wish to cancel?");
      if (isCancel) return true;

     return false;
  }  
  </script>
  <apex:sectionHeader title="New Customer Opportunity" subtitle="Step 1 of 3"/>
    <apex:form>
      <apex:pageBlock title="Customer Information" mode="edit">
      <apex:pageBlockButtons>
          <apex:commandButton action="{!step2}" value="Next"/>
          <apex:commandButton action="{!cancel}" value="Cancel" 
                              onclick="return confirmCancel()" immediate="true"/>
        </apex:pageBlockButtons>
      <apex:pageBlockSection title="FeedBack">
     <apex:inputField id="myPicklist" required="true" value="{!FeedbackFrom__c.X2_Are_you_Satisfied_with_our_production__c}"/><br /> <br /> 
              </apex:pageBlockSection>
       </apex:pageBlock>
  </apex:form>
</apex:page>

But am Getting Unknown property 'Pageniation.FeedbackFrom__c' error please help me out from this issue.

1
  • 3
    It's Fed not FeedbackFrom__c; Commented Apr 11, 2017 at 5:53

1 Answer 1

0

You can use instance references in the Visualforce page, not the object type.

So when you do <apex:inputField id="myPicklist" required="true" value="{!FeedbackFrom__c.X2_Are_you_Satisfied_with_our_production__c}"/>, the visualforce page could not find any instance with name FeedbackFrom__c in the controller.

You have an instance named - fed which is of type FeedbackFrom__c, so you should use fed.X2_Are_you_Satisfied_with_our_production__c instead of FeedbackFrom__c.X2_Are_you_Satisfied_with_our_production__c.

What @itszmukeshy commented is correct, I just thought there should be an explanation.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .