The code below works but the moment that I set my questioneditorpanel as
invisible to start with (even with the setOutputMarkupPlaceholder(true)),
the the draggable behavior stops working. I don't know why this is
happening? Any tips on where to start looking?
Thanks,
Pieter
QuestionEditPanel.java
==================
.....
questioneditorpanel=new Label("questionformatpanel",new
Model("AAAAAAAAAAAA"));
questioneditorpanel.add(new DraggableBehavior());
questioneditorpanel.setOutputMarkupId(true);
//questioneditorpanel.setVisible(false);
questioneditorpanel.setOutputMarkupPlaceholderTag(true);
I replace each of the these questioneditorpanels with an ajax link and add a
new DraggableBehavior to each new QuestionEditorPanel as required.
AjaxFallbackLink editor = new AjaxFallbackLink("editor") {
@Override
public void onClick(AjaxRequestTarget target) {
QuestionEditorPanel replacement=new
QuestionEditorPanel("questionformatpanel",
questionmodel,templatemodel,panel);
panel.setQuestionFormatPanel(replacement);
replacement.add(new DraggableBehavior());
target.addComponent(replacement);
}
--
Pieter Claassen
musmato.com