1

I have shown some fields in my component page and i am using that component in my main page..I want to get the list value that i have used in my component class to my main controller class..I tried to extend my component class and tried to access the list but i am getting a null list..

Component

<apex:component controller="objectComController">
 <apex:repeat value="{!objectList}" var="wra" id="theRepeat">
  <apex:inputField value="{!wra.nameField}"></apex:inputField>
 </apex:repeat>
</apex:component>

Component Class

public with sharing abstract class objectComController{
public List<object__c> objectList{get;set;}

public objectComController()
{
    objectList=new List<object__c>();
}

}

I am getting the values in objectList in this component controller.

Main Class where i have used this controller

public with sharing class mainClass extends objectComController{

   public void Save()
   {
       System.debug('============'+objectList);

   }
}

When i am trying to debug the values of the list in my maincontroller the values are coming null.I just need to get my list values from my component class in my main class.

Its very urgent for me.Please help.Thanks in advance.

1

This has been documented in the below blog link

https://developer.salesforce.com/page/Controller_Component_Communication

Also its been answered at stackoverflow

https://stackoverflow.com/questions/6103363/how-to-get-in-a-visualforce-page-controller-a-value-from-a-custom-component-cont

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.