List of List in VisualForce

June 05, 2012

    // VF Page 
<apex:repeat value="{!MyTrows}" var="rows">
        <apex:repeat value="{!MyTcols}" var="cols">
            <apex:outputText value="{!MyT[rows][cols]}" />
        </apex:repeat>
     </apex:repeat>



//Controller

public List> MyT{
get{
List a=new List{'a','b','c'};
List b=new List{'d','e','f'};
List> ab=new List>{a,b};
return ab;
}
set;

}

public List MyTcols{
get{
return new List{0, 1, 2};
}
set;
}

public List MyTrows{
get{
return new List{0, 1};
}
set;
}

Popular Posts

Twitter