private static final long serialVersionUID = 261756719214828133L;
public AccordionPanel(String id) {
super(id);
Accordion accordion = new Accordion("accordion");
accordion.setCollapsible(true);
accordion.setActive(false);
accordion.setAnimate(new AccordionAnimateOption(200));
add(accordion);
Label indexLabel = new Label("indexLabel");
indexLabel.setOutputMarkupId(true);
add(indexLabel);
JsStatement getActiveStatement = new JsQuery(accordion).$().chain("accordion", "'option'", "'active'");
CharSequence labelValue = "'Active is: ' + " + getActiveStatement.render(false);
accordion.setActivateEvent(JsScopeUiEvent.quickScope(new JsQuery(indexLabel).$().chain("text", labelValue)));
}