• Ravi Sriram
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
Hello i was trying to display info from my Wrapper Class to VF Page but i am not able to find where i was doing wrong .. could someone please help me out with this.

here are my controller and VF page codes.

VF Page
<apex:page controller="Aclist3">
  
  <apex:form >
      <apex:pageBlock >
          <apex:pageblockTable value="{!Mytablerow}" var="t">
                <apex:column value="{!t.theAccount.Name}"/>
                <apex:column value="{!t.theContact.Name}"/>
          </apex:pageblockTable>
              
      </apex:pageBlock>
              
   </apex:form>
</apex:page>

CONTROLLER



public class Aclist3 {

    public aTableRow getMytablerow() {
        return null;
    }

    Public List<aTableRow> tableRows {get; set;}
    public Aclist3()
        {
        
       List<aTableRow> tableRows = new List<aTableRow>();
       
       Account a = [SELECT Name FROM Account LIMIT 1];
       Contact c = [SELECT Name FROM Contact LIMIT 1];
       
       aTableRow Mytablerow = new aTableRow();
       
       MyTablerow.theAccount = a;
       MyTablerow.theContact = c;
             system.debug('temp******'+myTablerow.theAccount.Name);
        }

Public Class aTableRow
    {
        Public Account theAccount {get; set;}
        Public Contact theContact {get; set;}
        
        
    }
    
    
}
Hello i was trying to display info from my Wrapper Class to VF Page but i am not able to find where i was doing wrong .. could someone please help me out with this.

here are my controller and VF page codes.

VF Page
<apex:page controller="Aclist3">
  
  <apex:form >
      <apex:pageBlock >
          <apex:pageblockTable value="{!Mytablerow}" var="t">
                <apex:column value="{!t.theAccount.Name}"/>
                <apex:column value="{!t.theContact.Name}"/>
          </apex:pageblockTable>
              
      </apex:pageBlock>
              
   </apex:form>
</apex:page>

CONTROLLER



public class Aclist3 {

    public aTableRow getMytablerow() {
        return null;
    }

    Public List<aTableRow> tableRows {get; set;}
    public Aclist3()
        {
        
       List<aTableRow> tableRows = new List<aTableRow>();
       
       Account a = [SELECT Name FROM Account LIMIT 1];
       Contact c = [SELECT Name FROM Contact LIMIT 1];
       
       aTableRow Mytablerow = new aTableRow();
       
       MyTablerow.theAccount = a;
       MyTablerow.theContact = c;
             system.debug('temp******'+myTablerow.theAccount.Name);
        }

Public Class aTableRow
    {
        Public Account theAccount {get; set;}
        Public Contact theContact {get; set;}
        
        
    }
    
    
}