+ Start a Discussion

Nested wrappers view in vf page


So ive made those nested wrappers which work fine!

public class firstwrapper{
        public contact con {set;get;}
        public list <secondwrapper> second_list {set;get;}
        public firstwrapper(contact con, list <secondwrapper> second_list){
            this.con = con;
            this.second_list = second_list;
public class secondwrapper{
        decimal counter {set;get;}
        integer num {set;get;}
        decimal average {set;get;}
        sObject__c object_name {set;get;}
        public secondwrapper(decimal counter, integer num, decimal averege, sObject__c object_name){
            this.counter  = counter ;
            this.num = num;
            this.average = average;
            this.object_name = object_name;
  So, the code works good.  
My problem is how to display them in my vf page.
 Im trying:

<apex:pageBlock title="Title">
         <apex:pageblocktable value="{!firstwrapper}" var="first">
                <apex:column headervalue="Name">
                    <apex:outputtext value="{!first.contact.Name}"/>
                <apex:column  headerClass="ct">
                    <apex:facet name="Facet Name">
                    <apex:pageblocktable value="{!first.second_list}" var="sec">
                        <apex:column headervalue="fieldname">
                            <apex:outputtext value="{!sec.object_name.sobjectfield}"/>
                        <apex:column headervalue="counter" value="{!sec.counter}"/>
                        <apex:column headervalue="num" value="{!sec.num}"/>
                        <apex:column headervalue="average" value="{!sec.average}"/> 

but cannot even compile. while i save im getting:

"Error: Unknown property '<classname>.secondwrapper.object_name'"

Any suggestions???

Thanks in advanced
you have defined the wrapper classes. but did you define the properties in the VF contorller using the Wrapper classes?
define the properties and then use that property name.
public class controller {
public controller.firstwrapper first {get;set}

 public class firstwrapper{


BalajiRanganathan  - Thank you for your answer, ive tryed it. still not working...