Hello,
I'm trying to programmatically add tabs to an accordion component. When a
tab is selected I want to display a tree component in the tab content area.
I can add tabs without a problem but the tree is never displayed.
Here's my code:
@Override
public void prerender() {
accord.setLoadOnSelect(true);
List accordChilds = getAccord().getChildren();
for(Customer c : customerBeanBean.getAllCustomers()) {
Tree tree = new Tree();
List children = tree.getChildren();
TreeNode node1 = new TreeNode();
TreeNode node2 = new TreeNode();
TreeNode node3 = new TreeNode();
node1.setText(c.getCity());
node2.setText(c.getEmail());
node3.setText(c.getPhone());
children.add(node1);
children.add(node3);
children.add(node2);
// tabcontent
TabContent content = new TabContent();
List tabContentChildren = content.getChildren();
tabContentChildren.add(tree);
// tab
AccordionTab tab = new AccordionTab();
List tabChildren = tab.getTabChildren();
tabChildren.add(tree);
tab.setTitle(c.getName());
accordChilds.add(tab);
}
}
--
MvH // Olle Mårtensson
------------------------------------------------------------------------------------
cell: +46 703429410
mail: olle.martensson_at_gmail.com
Addr: Engelbreksgatan 9 58221 LINKÖPING SWEDEN
------------------------------------------------------------------------------------