Has anyone had experience using jQuery's Sortables [1] with Wicket?
These allow the user to reorder lists, even nested lists, by dropping
and dragging them in the browser.  The main interface back to Wicket
would probably come in the "serialize" method, which returns a String
representing the new ordering of the items in a Form-escaped format,
probably best shown with an example.

If, for instance, you had this original list:

    <ul>
      <li id="item-0">Lorem</li>
      <li id="item-1">ipsum</li>
      <li id="item-2">dolor
        <ul>
          <li id="item-2-0">sit amet</li>
          <li id="item-2-1">consectetuer</li>
        </ul>
      </li>
      <li id="item-3">adipiscing</li>
    </ul>

the serialization would generate:

    item[]=0&item[]=1&item[]=2&item-2[]=0&item-2[]=1&item[]=3

If you then drag ipsum after dolor, so it looked like this:

    # Lorem
    # dolor
        * sit amet
        * consectetuer
    # ipsum
    # adipiscing

the serialization would yield:

    item[]=0&item[]=2&item-2[]=0&item-2[]=1&item[]=1&item[]=3

Obviously I can stick that serialized version inside a form or in an
AJAX request, but I'm not quite sure what to do with it from Wicket.  Is
there any approach more elegant than manually deserializing the String
and reconstructing the new order manually?

I think there might be a bug in the serialization of nested lists that I
will take up with the jQuery UI team, but are there any suggestions for
how this could be hooked together with Wicket?

Thanks for any insights you can offer,

  -- Scott Sauyet

[1] Documentation is at http://docs.jquery.com/UI/Sortables/sortable
    Demo is at http://dev.jquery.com/view/trunk/ui/demos/ui.sortable.html


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to