users@woodstock.java.net

Re: Accordion programmatically

From: Olle Mårtensson <olle.martensson_at_gmail.com>
Date: Tue, 4 Dec 2007 20:10:48 +0100

Hello Ratnadeep and thank you for answering.
No I do not see markup on the client side I see something like this:
( webui.suntheme.widget.accordionTab","tabContent":[] )
If I add the TabContent with the tree as child to the accordion
instead of the accordiontab the tree is shown but of course without
tabs.
If I add the tree to the tabs as child the only the tabs are shown not the tree.
The reason that I started experimenting with tabcontent is because it
did not work out for me with accordiontab. Removal of loadOnSelect is
no good either.

2007/12/4, Ratnadeep Bhattacharjee <Ratnadeep.Bhattacharjee_at_sun.com>:
> Olle Mårtensson wrote:
> > 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);
> > }
>
> Why are you adding both TabContent and AccordionTab to the accordion -
> it should be the latter. On the client side can you see the tree markup
> ? Also, try removing the loadOnSelect for now...
>
> -Deep.
>
> >
> > }
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_woodstock.dev.java.net
> For additional commands, e-mail: users-help_at_woodstock.dev.java.net
>
>


-- 
MvH // Olle Mårtensson
------------------------------------------------------------------------------------
cell: +46 703429410
mail: olle.martensson_at_gmail.com
Addr: Engelbreksgatan 9  58221 LINKÖPING SWEDEN
------------------------------------------------------------------------------------