jQuery Drag Drop - how to fetch the dropped value in the server end?


jQuery Drag Drop - how to fetch the dropped value in the server end?



I have an application which uses jQuery UI to drag a LI from one UL to another. the asp code for the same is as follows:

<script type="text/javascript" src="../../jquery/jquery-1.3.2.js"> </script>  <script type="text/javascript" src="../../jquery/ui.core.js"> </script>  <script type="text/javascript" src="../../jquery/jquery-ui-1.5.3.custom.min.js"> </script>  <script type="text/javascript">     $(function() {         $("#selectedUsers").sortable({ connectWith: ["#userList"] });         $("#userList").sortable({ connectWith: ["#selectedUsers"] });     }); </script> 

  Tea Coffee Juice User list

                    </ul>                 </div>             </div>             <asp:Label ID="lblDisplay" runat="server"></asp:Label>             <asp:Button ID="btnSubmit" runat="server" Text="Submit"                 />         </div>     </asp:Panel> </div> 

My question is.. How do I capture the dropped LI element at the server end? I wanted the jQuery to return the id/value of this dropped LI to the server end..

Thanks in advance




Jsf component for html tag

1:



JSF - serving a page without xhtml
You need to specify a "receive" event handler for when the dragged item is received, such as.
Duplicate Id. JSF
$("#selectedUsers").sortable({      connectWith: ["#userList"],     receive: function(event, ui) {        objectMoved(ui.sortable, this);     } });  function objectMoved(obj, newContainer) {    /* here you would either perform some sort of AJAX request,     * or dynamically add/update a form-field for POSTing if you     * are doing standard form submission     */ } 
You'll also need to attach the same receive event to "userList".
tool or plugin available to convert HTML to JSF tags
Note that I haven't used the "sortable" ui helper before, but it should be a similar principle to "draggable" and "droppable", and I've based my example on what I know from these other two helpers - if it's not entirely correct, it should be close..
Redirecting on session timeout in JSF-Richfaces-facelet


Change the upload directory path for an ice:inputFile component


Disable commandButton in JSF

2:



Caching instances in a Java EE web app
It is working perfectly for me...

Am using the hidden field in input tag to capture the value of the dropped item.

However, i'm not able to actually capture the value of the dragged variable in IE..

It works fine when i do it in Firefox using this peice of code....
        $("#userList").bind('sortreceive', function(event, ui) {             var itemList = ui.originalTarget.innerHTML;             alert(itemList);         }); 
I also tried doing this.... alert(ui.item.attr('id'));. However, the windows apparently is not able to recognize the id of the li or the inner html present in the li which is being drag-dropped...



75 out of 100 based on 45 user ratings 645 reviews