0

i m trying to learn about visualforce page based on my understanding, after reading the material from web and workbooks. I created an C.Object called Book__c and calling custom fields to a visualforce page. I have controller where i m using a soql query to get the fields to use in my vf page. Can anybody tell me what i m doing wrong?

Error:

Error: Unknown property 'testController.Describe__c'

-----------------------------------vfpage--------------------------------------

<apex:page controller="testController" sidebar="false" showHeader="true" standardStylesheets="true">
    <apex:pageBlock title="Hello {!$User.FirstName}! " >

    </apex:pageBlock>
    <apex:form>
    <apex:pageBlock title="Testing picklist values with dependent list">
        <apex:inputtext value='{!Describe__c}' />
    </apex:pageBlock>
    </apex:form>
   <apex:detail subject="{!account.ownerId}" relatedList="true" />
</apex:page>

and here is my controller

public class testController {

        public Book__c myBook {get; set;}


    public testController(ApexPages.StandardController controller) {
    myBook = new Book__c();
    myBook = [SELECT books__c,Describe__c,Id,Name,OwnerId,RecordTypeId FROM Book__c];

    }

    public testController(){


    }

    //mylist = new list<Book__c>();



    public pageReference cancel(){

    Id fId = ApexPages.currentPage().getParameters().get('Id');
    pageReference p = new pageReference('/a00/o');
    return p;
    }

    public pageReference save(){
    pageReference p;
    String Rtype = ApexPages.currentPage().getParameters().get('Rtype');
    myBook.RecordTypeId = Rtype;
    insert myBook;
    return p;
    }

4

Describe__c is a field on the Book__c myBook property of the controller. You must access it in your Visualforce page through the myBook property:

<apex:inputtext value='{!myBook.Describe__c}' />
  • Sure! Glad to help. You were really close. :-) – Peter Knolle Jan 18 '14 at 3:15

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.