Re: Confused over AjaxDraggable

From: Thomas (webobject..oomeranet.com.au)
Date: Sun Jun 01 2008 - 18:08:00 EDT

  • Next message: Lachlan Deck: "externalToolBuilders prefs?"

    To answer my own first question: it looks like AjaxDraggable doesn't
    like being generated during AJAX requests.

    In the example below, AjaxUpdateContainer 2 is a windoid showing
    details of an entity that is selected by the AjaxUpdateLink, so you
    can edit the entity and select other entities without having to reload
    the page. However, AjaxUpdateContainer 2 contained a conditional so
    that if no entity was selected, it did not contain anything, not even
    the AjaxDraggable. So when you closed the windoid, the AjaxDraggable
    didn't exist any more, and selecting an entity without reloading the
    page generated a new AjaxDraggable that didn't drag.

    So my solution is to leave the AjaxDraggable in place, with the
    conditional inside it, and change the AjaxDraggable class to be hidden
    when there is no selected entity.

    Hope that helps some other Ajax newbie.

    BTW, it is so cool that you can drag a whole semi-transparent form
    around the screen!

    Regards
    Thomas

    On 01/06/2008, at 6:13 PM, Thomas wrote:

    > Simple draggables work fine for me, but I am getting very
    > intermittent results with what I'm trying to do, and I just wondered
    > if I am trying to do too much.
    >
    > I have some nested containers:
    >
    > <AjaxUpdateContainer 1>
    > ...stuff...
    > <AjaxUpdateLink that updates container 2 />
    > <AjaxUpdateContainer 2>
    > <AjaxUpdateLink that updates container 1 />
    > <AjaxDraggable>
    > content
    > </AjaxDraggable>
    > </AjaxUpdateContainer>
    > </AjaxUpdateContainer>
    >
    > Some apparently random time, but not often, the AjaxDraggable is
    > draggable. Mostly it is not. Reloading the page sometimes helps. Is
    > this supposed to work?
    >
    > All the other updating works brilliantly, and I think it's great.
    > But I just can't figure out the draggable.
    >
    > As a bonus question, Scriptaculous allows you to define the ID of an
    > element inside the dragged container that is used as a handle. Is
    > there any way to do that?
    >
    > Regards
    > Thomas
    >
    >



    This archive was generated by hypermail 2.0.0 : Sun Jun 01 2008 - 18:09:09 EDT