I am using this below wrapper class in a method which is called from a action support from vf page.

In debug log - @@@@offerId --> Id of the record

But @@@@offervalue i am getting null. I am not sure why i am getting null..

public List<Wrapper> WrapperList {get;set;}

for( integer i=0 ; i < WrapperList.size(); i++ ) {
system.debug('@@@@offerId' + soWrapperList[i].soW.Testlookup__c);
 system.debug('@@@@offervalue' + soWrapperList[i].soW.Testlookup__r.Name);

Wrapper class -

 Public class Wrapper {
 public Test__c soW { get; set; }
  • what data are you adding data into the wrapperList? – Rao Aug 15 '17 at 16:47
  • wrapperList .. i am using it as i am creating new rows...Testlookup__c is a lookup field.. which i am adding from vf page.. – hellraizer Aug 15 '17 at 16:48

when using a standard controller you don't get the values beyond the root object, create a query in your constructor to pull in the lookup values you require.

Select id, name, Lookup_r.Name from Test__c where id=:Testid

  • That's not strictly true. It only queries fields that you statically reference, which can be relationships. – sfdcfox Aug 15 '17 at 19:10

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.