Snippet from the controller and map sample data is below. I am having issue getting to the elements within the map using apex repeat.
I thought I would be able to do {!getAllOptions[tab].tabname} but that gives me Unknown Property 'OptionsController.Tab.tabname'.
Example image of what !getAllOptions[tab] returns:
My desired output of map below is:
Product | |
---|---|
ABC | 333 |
AGD | 4444 |
Geometric | |
---|---|
ASD | 333 |
FWS | 333 |
Below is the snippet from my controller. I also included my VFP code.
{1=Tab:[options={1=Option:[optdesc=333, udcdesc=ABC], 2=Option:[optdesc=4444, udcdesc=AGD]}, tabname=Product], 2=Tab:[options={1=Option:[optdesc=333, udcdesc=ASD], 2=Option:[optdesc=333, udcdesc=FWS]}, tabname=Geometric]}
public class Tab{
String tabname {get; private set;}
Map<Decimal,Option> options {get; private set;}
}
public class Option{
String optdesc {get; private set;}
String udcdesc {get; private set;}
}
public Map<Decimal,Tab> getAllOptions {
get{
Map<Decimal,Tab> tabs = new Map<Decimal,Tab>();
Tab tab = new Tab();
tab.tabname='Product';
Map<Decimal,Option> options = new Map<Decimal,Option>();
Option option= new Option();
option.udcdesc='ABC';
option.optdesc='333';
options.put(1,option);
option= new Option();
option.udcdesc='AGD';
option.optdesc='4444';
options.put(2,option);
tab.options = options;
tabs.put(1,tab);
/* ********* */
tab = new Tab();
tab.tabname='Geometric';
options = new Map<Decimal,Option>();
option= new Option();
option.udcdesc='ASD';
option.optdesc='333';
options.put(1,option);
option= new Option();
option.udcdesc='FWS';
option.optdesc='333';
options.put(2,option);
tab.options=options;
tabs.put(2,tab);
/* ********* */
return tabs;
}private set;
}
VFP
<apex:page controller="Optionsv2Controller" standardStylesheets="false">
<div>
<table>
<apex:repeat value="{!getAllOptions}" var="tab">
<tr>
<td><apex:outputText value="{!getAllOptions[tab].tabname}"></apex:outputText></td>
</tr>
</apex:repeat>
</table>
</div>
</apex:page>
public
help i.e.public String tabname {get; private set;}
?