[jQuery] problem Form plugin + UI sortable

[jQuery] problem Form plugin + UI sortable


Hi everyone,
I'm new to ajax and I can't figure out how to set my jqueries in the
response.
Yet, I'm using a basic way for my Ajax.
I have set with the form plugin an ajaxForm and when the response is
ready, it displays it in the targetted div:
/
***************************************************************************/
//CODE of assembler.jsp
<html>
<head>
</head>
<body>
<script type="text/javascript" src="/scripts/jquery.js"></script> //
v1.3.2
<script type="text/javascript" src="/scripts/jquery_form.js"></
script>//v2.07
<script type="text/javascript">
$(document).ready( function() {
$('#listFileForm').ajaxForm({
type: 'POST',
target: '#listFileResult',
resetForm:true
});
});
</script>
<form:form id="listFileForm" action="assembler.do" enctype="multipart/
form-data">
<input type="file" name="theForm.file" width="25px" />
<input type="submit" class="button" name="assemblerAjaxSubmit"
value='Add' />
</form:form>
<div id="listFileResult"></div>
</body>
</html>
/
***************************************************************************/
The response that will be display in the div is a JSP-file which
create a list (ul li). I want this list to be sortable but I can't
figure out how to set it as sortable
I have tried this but it does not work. I assume there is no document-
ready event when this view is displayed. I have also tried to set it
in the page that calls this ajax function (without believing that it
would work) and it didn't work
/
***************************************************************************/
//CODE of ajaxReturn.jsp
<script type="text/javascript" src="/scripts/jquery-
ui-1.7.2.custom.js"></script>
<script type="text/javascript">
// When the document is ready set up our sortable with it's inherant
function(s)
$(document).ready(function() {
$("#test-list").sortable({
update : function () {
var order = $('#test-list').sortable('serialize');
alert(order);
}
});
});
</script>
<ul id="test-list">
//list items created by my jsp
</ul>
/
***************************************************************************/
So where am I wrong please? How should I do?
Thanks for your help.