That's a ton of code - which is really hard to debug on a mailing list post. If you'd like someone to look at your specific issue, it'd be helpful to create a quickstart. Alternatively, explain your question a little more and post a snippet of the resulting HTML.
PS - have you tried making your additional data a panel that is setVisible(false).setOutputMarkupPlaceholder(true) by default, and then making your link simply setVisible(true) on the panel and add it to the ajax request target? It may be easier than a fragment. I've used that pattern quite a few times. -- Jeremy Thomerson http://www.wickettraining.com On Tue, May 18, 2010 at 1:52 AM, Dr. Wolf Blecher < [email protected]> wrote: > Thanks for the response. Attached is the markup and the java classes for > the > panel. It's slightly modified since normally a DataView is used, but the > behaviour is the same with the ListView. This is only the panel class and > not > a complete quickstart. > > Here is the markup > > <html xmlns:wicket> > <head> > <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> > <title>TreeDataViewPanel</title> > </head> > <body> > <wicket:panel> > <table> > <thead> > <tr> > <th></th> > <th>Name</th> > <th>Vorname</th> > </tr> > </thead> > <tbody> > <div wicket:id="overview"> > <div wicket:id="extendingRow">USer Data here</div> > </div> > </tbody> > </table> > </wicket:panel> > </body> > </html> > > <wicket:fragment wicket:id="rowView"> > <tr> > <td> > <a wicket:id="extendLink"> > <span wicket:id="extendSymbol">Arrow</span> > </a> > </td> > <td> > <div wicket:id="name">Name</div> > <div wicket:id ="details"> > <ul> > <li><b>Again</b><span wicket:id="strasse">Strasse</span></li> > </ul> > </div> > </td> > <td><span wicket:id="vorname">Vorname</span></td> > </tr> > </wicket:fragment> > > and the corresponding Java > > public class TreeDataViewPanel extends Panel { > > private List<String> userList = Arrays.asList("User 1","User 2","User 3"); > > public TreeDataViewPanel(String id) { > super (id); > ListView<String> userTable = new ListView<String>("overview", userList) > { > @Override > protected void populateItem(ListItem<String> item) { > String user = item.getModelObject(); > > DetailFragment dataView = > new DetailFragment("extendingRow","rowView",user); > dataView.setOutputMarkupId(true); > item.add(dataView); > } > }; > add(userTable); > } > } > > class DetailFragment extends Fragment { > > private boolean compressed = true; > > public boolean isCompressed() { > return compressed; > } > > public void setCompressed(boolean compressed) { > this.compressed = compressed; > } > > public DetailFragment(String id, String markupId, String user) { > super(id, markupId); > > WebMarkupContainer detailContainer = new WebMarkupContainer("details") { > @Override > public boolean isVisible() { > return !isCompressed(); > } > }; > > add(new DropDownLink("extendLink", this)); > add(new Label("name", user)); > add(new Label("vorname", user)); > > detailContainer.add(new Label("strasse", user)); > add(detailContainer); > } > } > > > class DropDownLink extends AjaxLink { > > DetailFragment parent; > Label compressedSymbol = new Label("extendSymbol","\u25B6"); // 9654 > Label expandSymbol = new Label("extendSymbol","\u25BC"); // 9660 > Label linkSymbol; > > @Override > public void onClick(AjaxRequestTarget target) { > if (parent.isCompressed()) { > linkSymbol.replaceWith(expandSymbol); > linkSymbol = expandSymbol; > parent.setCompressed(false); > } else { > linkSymbol.replaceWith(compressedSymbol); > linkSymbol = compressedSymbol; > parent.setCompressed(true); > } > target.addComponent(linkSymbol); > target.addComponent(parent); > } > > public DropDownLink(String id, DetailFragment parent) { > super(id); > linkSymbol = compressedSymbol; > linkSymbol.setOutputMarkupId(true); > expandSymbol.setOutputMarkupId(true); > compressedSymbol.setOutputMarkupId(true); > this.parent = parent; > add(linkSymbol); > } > } > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
