hello,
i want to write an collapsebehavior based on bootstrap collapse (
http://getbootstrap.com/javascript/#collapse). so you have an icon or
button or waht else which will toggle a container. both components are
independent added to the page or panel.

example:

public class CollapseBehavior extends Behavior {
   private final IModel<String> targetMarkupId;

   public CollapseBehavior(Component target) {
      target.setOutputMarkupId(true);
      target.add(new CssClassAppender("collapse"));
      targetMarkupId = target.getOutputMarkupId();
   }
}


public class HomePage extends WebPage {
   public HomePage() {
      Button collapse = new Button("button");
      WebMarkupContainer target = new WebMarkupContainer("body");
      collapse.add(new CollapseBehavior(target));
      add(collapse);
      add(target);
   }
}

wicket guide says do not pass components during construction. Is there a
better way?

regards

john.j.cool

Reply via email to