Last time I checked, and it's been a while, the setOutputMarkupPlaceholderTag 
behavior was to create an element like "<div id='wicketId' style='not visible' 
/>" and then when you set it back to visible you end up with the proper html: 
"<div id='wicketId'>content here</div>".  I don't know anything about the 
draggable behavior but I assume it must be client-side stuff attached to the 
DOM node.  When you set the panel back to visible wicket will do an outer html 
replace and you end up with a new DOM node that doesn't have your draggable 
behavior attached.

BTW, this is a bit of speculation but sounds reasonable eh?

Craig

-----Original Message-----
From: pieter claassen [mailto:pieter.claas...@gmail.com]
Sent: Monday, November 23, 2009 8:22 AM
To: Martin Makundi
Cc: users@wicket.apache.org
Subject: Re: setVisible(false) kills DraggableBehavior()

Note that in the AjaxLink I create a new replacement panel, add a dragging
behavior to it and then replace the old one with it (code below). My
question is that even though I add a draggable behavior to the new panel and
do the proper replacement, it stops working as soon as I start of with an
invisible panel (with setOutputMarkupPlaceholderTag(true)). I thought the
whole objective of setOutputMarkupPlaceholderTag is to just to do an inline
style change to invisible while holding the rest of the code including the
component id's the same).

    public void setQuestionFormatPanel(QuestionEditorPanel qfp){
        questioneditorpanel.replaceWith(qfp);
        this.questioneditorpanel=qfp;
    }

On Mon, Nov 23, 2009 at 2:00 PM, Martin Makundi <
martin.maku...@koodaripalvelut.com> wrote:

> > This drabable code works fine until I set isVisible(false) on the panel I
> > want to drag around. Then all ajax events from dragging the panel
> > disappears.
>
> Do you really expect to drag something that is not rendered on the browser?
>
> **
> Martin
>
> >
> > Regards,
> > Pieter
> >
> > On Mon, Nov 23, 2009 at 1:34 PM, Martin Makundi <
> > martin.maku...@koodaripalvelut.com> wrote:
> >
> >> What is in draggablebehavior? That might be the problem.
> >>
> >> **
> >> Martin
> >>
> >> 2009/11/23 pieter claassen <pie...@claassen.co.uk>:
> >> > 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
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >> For additional commands, e-mail: users-h...@wicket.apache.org
> >>
> >>
> >
> >
> > --
> > Pieter Claassen
> > musmato.com
> >
>



--
Pieter Claassen
musmato.com



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to